How to re-import database tables for the NextGen Gallery Plugin when moving your WordPress website to a new domain – so your photo galleries work again!
Sometimes a website’s content needs to be moved to a new domain. If there are pictures and plugins involved, the process gets a little more complicated. I wanted to move a blog with posts and photo galleries from synergyindesign.com to a totally different subdomain. There are really good instructions on what to do when moving your WordPress website to a new domain, and instead of rewriting them, there are links below.
How to Move WordPress to a New DomainHow to Move a WordPress Blog or WebsiteThe keys to getting the NextGen Galleries back in working order on a different domain depends on being able to find and download the files that contain information about the previous NextGen database files in phpMyAdmin, then modifying and uploading them to the new domain’s server.
As I imported the xml file along with the whole wp-content folder (so the plugins were also replicated) onto the new – different server, I beamed with premature satisfaction that things seemed to be working. Then, with horror, I realized that the Nextgen photo galleries weren’t loading on the new site. (The Nextgen Gallery is a really great plugin for WordPress that allows uploading and organization for photos, among other things.)
I knew that the photos from the old site were in the new website and that all the previously used plugins had been reinstalled. This is because as the previous wp-content folder was being uploaded to the new server via ftp, I saw the photo names from the Nextgen Gallery uploading. (Downloading and uploading with compression took over one hour. I’m not complaining. Overall, it saved a lot of time.)
While I took care to replicate the posts, content and plugins, the galleries were not being accessed and could not be found. So, not wanting to upload over 100 photos and type all the photo details again, I started searching for a way to make this happen. The best explanation that I found was at the WordPress forums, but here are points of clarification.
Here’s a step by step way to get the Nextgen Galleries plugin working by going into phpMyAdmin.1. Log into the old server to access phpMyAdmin. Click on the correct database to find the wp_ngg_album, wp_ngg_gallery, and wp_ngg_pictures files. (My example is a bit wonky because I think I was messing around and did two installs, so your table info will likely not have the wp1.)
Here’s a screenshot of what PHPMyAdmin export values I used. (I had additional editing because my files had (wp1_ngg…) – a number one after wp, so I changed them all to wp – even for all of the picture files, but in the end, it worked!)
2. Export them one at a time by making sure that only the chosen one is highlighted (on my first try, by default, every file was highlighted) by looking over the export values, then click “Go” in the lower right hand corner of the page. This will allow you to name the file and save it to your computer. “Save as” a .txt file.
3. After downloading the files to your computer (see above, and before importing them to the new domain) open the files in a text editor to make sure that the correct, updated database name is in the file. Most people will only need to make sure that the new (destination) domain’s database be switched from the old one.
4. Now log into the new server’s PHPMyAdmin. (It’s assumed that WordPress has already been installed, so you’ve already created the new database, and the plugins have been added or replicated.)
5. Delete the wp_ngg_album, wp_ngg_gallery, and wp_ngg_pictures files, and use the import function to import your .txt files from your computer. (I had to delete them before importing them, but that probably had to do with which boxes I left check marked on the initial export.) This replicates the previous NextGen commands and tables so that all the previous photos and galleries can be accessed and display as before.
This worked for me. All the galleries were recognized and loaded just as in the previous domain. Hope that it works for you. Many thanks to Alex Rabe (NextGen Photo Gallery plugin) and Kevin Sylvestre (Slimbox display plugin) for creating and sharing the plugins.
Revisions
September 2, 2015 @ 14:26:36 [Current Revision] by PeterLugg
September 2, 2015 @ 14:26:36 by PeterLugg
Revision Differences
There are no differences between the September 2, 2015 @ 14:26:36 revision and the current revision. (Maybe only post meta information was changed.)
No comments yet.