As you have probably noticed, akingsmercury.com was offline for two days lately. I moved to another host in order to be prepared for a little more growth of my website (hopefully). Sorry for that!
I can console everybody that was sad about akingsmercury.com being offline by admitting that I was frustrated, too. I kind of looked like this all day: sad puppy. Hope that makes you feel better.
The Problem – SQL Database Import Error
It took me two days to restore my blog, because I had to face several SQL database import errors like:
#1046 – No database selected
#1298 – Unknown or incorrect time zone: ‘NULL’
Luckily, in the end I figured out how to handle the phpMyAdmin correctly, as you can see. To prevent you (and me) to go through such a struggle and google-search marathon (again) I prepared a step-by-step explanation of how to import your blog’s SQL database to your new host via phpMyAdmin (for WordPress).
Restoring Your WordPress Blog and SQL Database Correctly
I assume that you backed up your WordPress blog and database beforehand. If not, go and check out BackUpWordPress on how to do it.
Step 1: Create a new SQL database in your Control Panel. Preferably with the same name as your old database.
Step 2: Create a user for your SQL database in order to log into the phpMyAdmin
Step 3: Log into your phpMyAdmin and click the panel Databases. Now select the database you just created. This step is really important! If you click on Import and upload directly you will get the error: #1046 – No database selected
Step 4: Before you can import your blog’s database you have to name it exactly as the one you just created for example akingsmercury.sql or 55_myblog.sql. Just make shure that the database you want to upload and the one you newly created match in name.
Step 5: You can now already try to import your database, but you likely get error messages like: #1298 – Unknown or incorrect time zone: ‘NULL’. The reason for that is that your old database contains data that is incompatible with your new database. The good thing is all this information is written in comment lines that are deletable.
If you encounter an error like #1298 – Unknown or incorrect time zone: ‘NULL’ it also displays the line that causes this error. Now, open the SQL database you would like to import (ideally in program like McVim), press ⌘+f or control+f and search for the line your error message indicated (for example /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;). Delete this line, save your database and import it again. If another error message occurs then repeat this procedure until it work fine.
Step 6: Now you are ready to install WordPress by logging into your Control Panel and using the build-in WordPress installation or by downloading WordPress from WordPress.org and following the famous 5-minute installation guide. Don’t forget to change the wp-config-sample.php to wp-config.php and to fill in your database’s name, user name and password.
Step 7: Restore your old blogs content by logging onto your blog via ftp and replacing the wp-content folder with your old wp-content folder. Grab a cup of coffee because this could take a while …
Step 8: Log into your blog’s dashboard and activate your old theme if it isn’t already activated.
Step 9: Also make shure to update your old permalink structure by going to Settings>Permalinks in your dashboard and just click on Save Changes if the same as your old permalink structure is selected.
Step 10: If your media library is not working correctly go to Settings>Media and change the Store uploads in folder field to the default.
Step 11:Remember to create your old contact email address again via your control panel. If you use Outlook or Mail it is nice to have the same email address with the exact same settings and password.
That’s about it. If you have any further questions feel free to post them below. This article is a bit off-topic to my blog, but I hope you still found it useful.
Powered by Facebook Comments