• 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?
0
sandshakimi
Asked:
sandshakimi
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.

Installing

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.
0
 
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.

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

mysqldump

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] 
use DATABASENAME;
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.
0
 
fiboCommented:
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
0
 
nanharbisonCommented:
Wait! Use the module called Backup and Migrate, it is so simple!
0

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