How to Export / Import NextGEN gallery images

📂 Category: WP Plugins

🖺 Last modified: 7th Dec 2021

💻 Experience: Intermediate - Expert

🕑 Read Time: 6 min

NextGEN is probably the most popular and widely used gallery plugin for WordPress. It’s packed with useful features for managing and displaying galleries on WP websites and easy to use. Well, at least until it comes time to transfer NextGEN galleries from one website to another, since the plugin doesn’t have this feature implemented. This tutorial will teach you how to manually export NextGEN gallery from one website and import it into another.

The NextGEN Gallery Plugin for WordPress

NextGEN Gallery by Imagely has over 800.000 active installations and a solid 4.5 star rating by over 3800 developers in the WP Plugin Repository. This WordPress gallery plugin owns it’s huge popularity among developers to it’s reliability, structure and wide set of gallery management features. The plugin is simple to use just out of the box for less experienced users, but also very flexible and customizable to satisfy the most demanding users. NextGEN Gallery is a free plugin but it’s functionality can be hugely extended with a lot of paid add-ons.

The image galleries created in NextGEN are stored separately from the default WordPress media library, which makes their management much simpler and organised. The only downside of this plugin shows up in situations when you want to move or copy your galleries from one website to another. It is impossible to make the gallery migration from directly from WordPress since the plugin lacks of this feature, and there are no dedicated Export NextGEN Gallery plugins in the WP plugin repository.

Therefore, we decided to create this detailed step by export NextGEN gallery tutorial to guide you trough the process of galleries migration.

Before we begin the gallery migration process

We’ll do our best to make the import and export NextGEN gallery process easy to understand and perform for anyone. Even though, it would be recommended to have at least some experience in working with the hosting cPanel interface. Intermediate and experienced developers shouldn’t have any issues with following this tutorial.

That’s right, we’re going to do the galleries migration using the cPanel, since there’s no option to export NextGen gallery from within WordPress. Before we continue, make sure you have access to the hosting cPanels and get your login credentials ready. Of course, you’ll need login credentials for both hosting accounts – the one you are exporting the NextGEN galleries from and the one you are moving the galleries to.

 

METHOD 1: Moving a NextGEN gallery from one site to another using cPanel File manager only

If you need to migrate a single NextGEN gallery (or a couple of them) from one site to another you can use this simple export NextGEN gallery method. This method is intended for less experienced users and cases when you don’t have a lot of galleries and images to migrate.

The downside of this method is that it won’t copy any image meta data such as image description, alt text or image tags. If you’re not using any meta data for your images, this downside is irrelevant. Otherwise, you will have to manually copy or rewrite that information, once you’re done with the export NextGEN gallery process.

The procedure to export NextGEN gallery using cPanel File manager only:

Source website cPanel:

  1. log in into the source website’s cPanel and open the File Manager
  2. open the gallery folder, located inside the source website’s wp-content folder – that’s where your NextGEN galleries and images are stored
  3. compress and download the NextGEN gallery (or galleries) you wish to export

NOTE: If both source and destiation websites are located under the same hosting account (same cPanel), you don’t need to compress and download to export NextGEN gallery. You can copy or move it directly into the gallery folder of the destination website.

 
Destination website cPanel:

  1. log in into the destination website’s cPanel and open the File Manager
  2. open the destination website’s wp-content folder, and create the gallery folder if it’s not there already (if you already created any galleries with NextGEN on the destination website, the gallery folder should be there)
  3. upload and decompress the galleries you previously exported from the source website into the destination website’s /wp-content/gallery/ folder
Export NextGEN Gallery and import in WordPress website

After you copy your NextGEN galleries from the source website to the destination website using cPanel File Manager, all you have to do is import them into WordPress trough the NextGEN plugin Import Gallery interface.

Destination website WordPress Dashboard:

  1. install the NextGEN gallery plugin on the destination website (if you’re not using it already)
  2. in the WP Dashboard’s right column menu, click on NextGEN â–¸ Add Gallery / Images
  3. on the Add Gallery / Images screen click on the Import Folder button and locate the gallery folder you previously uploaded
  4. make sure to mark the Keep images in original location checkbox and optionally fill the Gallery title field
  5. click on the Import Gallery button
  6. to complete the export NextGEN gallery process, now you can click on the Manage Gallery button and manually update the image meta data (descriptions, alt texts, tags) if you’re using it

NOTE: When the export NextGEN gallery process is complete, go back to the destination website cPanel and delete the original folder containing images you uploaded previously. That’s because NextGEN automatically creates a new copy of that folder during the import process. Make sure to delete the original folder, not the newly created one.

 

METHOD 2: Migrate a NextGEN gallery from one site to another using cPanel File manager and phpMyAdmin

This method to export NextGEN gallery is a bit more complicated that the previously described method. It requires a bit of knowledge on WordPress data tables and comfort in working with phpMyAdmin. Nevertheless, we’ll try to describe the process as simple and detailed as possible, so even less experienced developers can do it.

The export NextGEN gallery using phpMyAdmin is suitable for cases when you need to migrate a large quantity of galleries together with all the image meta data (descriptions, alt texts). This method is also intended for cases when you migrate all your galleries from the source website to a blank destination website (without any previously created galleries).

The procedure to export NextGEN gallery using cPanel File manager and phpMyAdmin:

Source website cPanel:

  1. log in into the source website’s cPanel and open the File Manager
  2. open the gallery folder, located inside the source website’s wp-content folder, where your NextGEN galleries are stored
  3. compress and download the NextGEN gallery (or galleries) you wish to export
  4. open the cPanel’s phpMyAdmin application
  5. select and export the following data tables from your WordPress data base: wp_ngg_album, wp_ngg_gallery, wp_ngg_pictures (this tables contain all your galleries and images meta data )
Export NextGEN Gallery using phpMyAdmin

NextGEN uses three separate data tables to store information about your galleries and images. Those tables store data such as image description and alt text but also post id’s, dates and file locations. Correctly migrating those tables is essential for a successfull export NextGEN gallery process.

Destination website cPanel:

  1. install the NextGEN gallery plugin on the destination website (if you haven’t already)
  2. log in into the destination website’s cPanel and open the File Manager
  3. open the destination website’s wp-content folder, and create the gallery folder if it’s not there already
  4. upload and decompress the galleries you previously exported from the source website into the destination website’s /wp-content/gallery/ folder
  5. open the cPanel’s phpMyAdmin application and delete (Drop) the current wp_ngg_album, wp_ngg_gallery, wp_ngg_pictures data tables (those tables are created automatically when the NextGEN plugin is installed)
  6. import the NextGEN data tables you previously exproted from the source website
  7. if you’ve done everything correctly, all migrated galleries should now appear in your website’s NextGEN Manage Galleries page

ATTENTION: As mentioned earlier, this export NextGEN gallery method is intended to migrate your galleries into a new website (without any previously created NextGEN galleries). If you already created some galleries and then delete the NextGEN data tables in phpMyAdmin, you will loose those galleries. In this case, use the Method 1 described earlier instead.

Pro Tip: Even though this procedure migrates the images meta data (descriptions, alt texts…), it won’t migrate image tags if you’re using them. That’s because image tags are stored in a different data table (wp-terms), together with other taxonomy used by WordPress. If you’re using tags, you’ll have to selectively export and import those tags from the wp-terms table.

 

Conclusion

Since there’s no simple way to migrate NextGEN galleries from one site to another, we tried to simplify the export NextGEN gallery procedure as much as possible. The methods we described are intended for two main situations. In case you have a situation different from what our methods are intended for, you should manage to migrate your galleries by slightly adjusting or combining the methods.

To learn more about various WordPress plugins and their possibilities, please browse our WP Plugins article archive.