I want to transfer a Moodle website and its database to another host (shared host), but my database backup is too large (120 MB), meanwhile max file size allowed to be imported is 50Mb, at phpMyAdmin. Is there any way to import this whole database at a time or to separate it into smaller .sql files ?
Asked
Active
Viewed 657 times
1
-
Possible duplicate of [PHP change the maximum upload file size](http://stackoverflow.com/questions/2184513/php-change-the-maximum-upload-file-size) This setting is found in your `php.ini` file, sometimes at `/etc/php5/apache2/php.ini` in linux. – JNevill Apr 11 '17 at 13:43
-
Also, your database backup file is probably just a bunch of individual SQL commands, so you could just break it up into smaller files, and load them in order. Being careful to not break up individual statements. – JNevill Apr 11 '17 at 13:45
3 Answers
2
You can either increase the necessary values in your php.ini file ''/etc/php.ini'' (RedHat)
post_max_size = 250M
upload_max_filesize = 250M
; Optional if the error persists
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M
or you do as the other two mentioned and import the file on shell using
mysql -u user -p database < YourSQL.sql

joelschmid
- 828
- 1
- 16
- 32
0
If your hosting account has SSH, Please restore the dump in commandline (using mysql command)

gnuwings
- 950
- 7
- 8
0
You can login to mysql console and select the db and run source command.
use database-name
source /file-path/to-sql-file.sql
Source command runs in small chunk so should not have problem with packet size

Bishwanath Jha
- 399
- 3
- 10