Wednesday, September 10, 2008

Copying production data to development environment

I wanted to copy all the data from the production environment on the server to my development environment on my laptop. The following worked:

1. In the Backstage area of site5 choose SiteAdmin > Web Site Tools > Download an SQL database backup and then choose the development database.

This produces an SQL dump of the database and all the data therein.

2. Download and save this file (say we save it as 'production_dump.sql' in 'some_path')

3. Run the following


mysql -h localhost -u root -p password myapp_development < some_path/production_dump.sql


(Syntax is "mysql -hHOSTNAME -uUSER -pPASSWORD DATABASE < DUMPED_TEXTFILE")

4. Download any files that may have been uploaded to the server using facilities such as attachment_fu.

No comments: