• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 564
  • Last Modified:

Best Practice to Export and Import Drupal Website?

I developed a Drupal 7 site on my local machine and want to share that with another party who has an equal WAMP stack Drupal environment.

So what's the best way for me to export my site and zip it over to them?
3 Solutions
Julian HansenCommented:
1. Backup the site files
2. Dump the database

With 2 dump the database without the create database / use database option

The files you can zip (or tar and gzip) whichever you prefer.


1. Create a root for the site
2. Extract the archive
3. Create and load the database to the database on the target machine
4. Truncate the cache tables
5. update /sites/default/settings.php with database settings.

That should be all that is required.
sandshakimiAuthor Commented:
Can you clarify the dump process?

Can I do this via phpMyAdmin. I have more experience with GUI than using MySQL command line.

But I can do whichever is best practice. With command line, I need specific steps.

Julian HansenCommented:
You can with PhpMyAdmin but best to do it with mysqldump as follows


backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

Open in new window

To restore you can use PhpMyAdmin as well or you can do it on the command line by logging in to MySQL and using source
mysql -u root -p[root_password] [database_name] 
source dumpfilename.sql

Open in new window

You can do it in one command like so
mysql -u root -p[root_password] [database_name] < dumpfilename.sql

Open in new window

But then you need to make sure that dumpfilename.sql has a USE database statement for the target database if it exists already otherwise a create database and use database if it does not.

PhPmyAdmin - will depend on your server setup (hosted) as to what functions are available.

You can also look at tools like SQLYog which if you have direct access to the database is far superior to PHPMyAdmin.
WARNING: when you are moving a drupal site from one place to the other, first take 40 seconds to clear all the caches (in the "performance" tab).

WHY: Otherwise the database will keep track of the "existing" (on the old site) files, and you might have problems for the site to update itself
Wait! Use the module called Backup and Migrate, it is so simple!

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now