This is an old revision of the document!
In the previous Tutorial we covered how to perform a Database Backup. In this Tutorial we will discuss how to restore the database if you need to. Some reasons for restoring a database would be:
Regardless of the situation, the process is always the same. Keep in mind, however, that when you restore a database you are effectively overwriting the existing database. Therefore, any changes to settings and templates, registrations that took place, listings that were entered, etc. between the time you performed your the back up until now will be lost. With that understanding, proceed as follows:
Ideally, you need to break the sql into 5 or 6 separate files. Simply open your .sql file and cut/paste a portion of the code into a new file. Save it and then repeat the process until you have created 5 or 6 separate files from the original .sql file. Your new files can be saved as any name you like. However, we recommend naming them by number so that you can maintain the order in which you upload them in a later step. ORDER IS IMPORTANT. For example, when you are finished you should have a set a files that look something like this: 1.sql, 2.sql, 3.sql, 4.sql, 5.sql, 6.sql
As long as you keep the files in order as described above, you don't have to worry about splitting up a large sql table between two files. If PHP finishes running a partial table in one file, it will then pick right back up and finish that table in the next file, if you upload them in the proper order.
<tip c w>Important: Ensure that your .sql file contains DROP TABLES for each table within the code. Failure to do so will result in error messages being displayed in phpMyAdmin. If you followed the steps in the "Backing up Your Database" Tutorial, then your .sql file should have drop tables in the code. See example below of what the first line in each table should look like.</tip>
droptable
- Log in to phpMyAdmin.
<tip c n>Note: The page layout and required steps may vary slightly depending upon the version of phpMyAdmin that is installed on your domain.</tip> <
myadmin_7 <
<tip c n>Note: Older versions of phpMyAdmin will not have an "import" tab. Instead, you will need to click on the "SQL" tab, as it will be your only option for importing SQL.</tip>
myadmin_8 <
myadmin_9 <
<tip c w>IMPORTANT: Ensure that your .sql file contains DROP TABLES for each table within the code. Failure to do so will result in error messages being displayed in phpMyAdmin. If you followed the steps in the "Backing up Your Database" Tutorial, then your .sql file should have drop tables in the code. See example below of what the first line in each table should look like.</tip> <