Migrating single drupal instant to a multi-site thats live I am having a drupal site developed and ready on my local server which is a standard drupal Installation. Back on server I have a multisite setup with 3 sites all using same database with different prefix for each site. Now I want to move this site that is on local server to replace one of the site in the multi-site online.

I am confused with the following things:


How do I export the db from a single instant and import it on server?
I only have phpmyadmin access. And all sites in multisite use same db and is prefixed.
How do I export the db from localhost with the required prefix.
Does the multisite db use all the tables I have in single instant?
Will importing the local tables to multi-site db overwrite the tables thats already there or will I have to delete the tables online first and then import?


What are the best steps to follow for my problem, I saw many conflicting info online and in this community. As I am doing this on a live site, dont wan't to break it.
On the local machine:


Execute SHOW TABLES to get a list of tables.
Copy the table names into a text file, one table per line.
Use your favorite tool to transform the lines from

tablename

to

RENAME TABLE tablename TO prefix_tablename;

Choose a table prefix different from the ones you have on the server. This ensures that no tables are overwritten when you import them to the server.
Execute the resulting script on the DB of your local installation.
Edit the settings.php to use the chosen table prefix.
Export the local database. You can use Backup and Migrate but you have to make sure to also export the structure of the cache tables, but not the content. You can also use phpMyAdmin, but you should empty (not delete) the cache tables and the watchdog table first. These tables can get quite large and their content is not essential to the operation of a drupal site.


On the server:


Import the SQL file of the backup into phpMyAdmin. This creates the necessary tables and fills them with the contents from you local machine. If the file is large, you might run into issues with max_execution_time and upload_max_filesize.
Create a new subdirectory under the sites directory and copy your local settings.php file into it.
Copy any modules, themes and file uploads required by your local site to the server.
Copy sites/example.sites.php to sites/sites.php. The file sites/sites.php allows you to map Drupal sites to arbitrary paths within the sites directory. Read the comments in that file for details.
Edit sites/sites.php so that the URL of the site to replace points to your new directory within sites.

Now you can make further adjustments to your new site without damaging the old one. Problems are usually caused by different locations of modules, themes and uploaded files. These problems cannot be solved by a simple search and replace on the database, because of the way Drupal stores some configuration information (serialized PHP arrays or objects). You might want to switch the site to maintenance mode while fixing such problems.
In case of panic, remove sites/sites.php and you have your old site back.