Removing a wordpress multisite installation and preserving the database before migrate to nginx

You can try a couple of things. WordPress has a built-in Importer/Exporter you can find under the Tools menu:

WordPress Admin "Tools" menu showing Import and Export features

The tool is a bit hit or miss, your mileage may vary.

Alternatively, you can do the following:

First, take backups of everything!!

It sounds like you already have, but do it again, just in case.

  1. Export only the wp_5_ tables from your current database to a SQL file.
  2. Next, create a fresh new WordPress single site. Don’t add any content or anything, just set it up.
  3. Import the SQL file from step 1. into your single site database. Now, you should have both wp_ and wp_5_ tables.
  4. You have a couple of options now:
    • In your wp-config.php, change this line $table_prefix = 'wp_'; to $table_prefix = 'wp_5_';
    • OR: Run a query like this for EVERY table you want to migrate:
INSERT INTO wp_posts SELECT * FROM wp_5_posts;
-- ... etc, so for terms you would do
INSERT INTO wp_terms SELECT * FROM wp_5_terms;