Posted by xl_cheese on November 22, 2010 at 6:54pm
I want to create a local copy of my site, but I'm really having a hard time getting it to work right. I've gotten close by using phpmyadmin to export/import the database, but things are kind of hokey. None of the java scripting works, and my theme/css is not quite right.
I've also tried the backup and migrate module with little success.
Maybe there's some tricks I can do to the live site to make it easier? I have the boost module enable. Maybe that is causing some of the issues?
Thanks.
Comments
What platform are you moving from/to?
I recently moved a site from a Centos on a dedicated server to an Ubuntu 10.10 on a local pc and had some real fun. Problems like php 5.3 instead of a much earlier php 5 release can really cause some unexpected stuff.
HostMonster to ubuntu 10.10.
I'll check out the mysql and php versions.
Thanks for the tips!
here is a little of what i've done
First make sure things like the php version and mysql version are similar. Then, make sure your files directory exists and is writable. Go to /admin/reports/status and see if there are any obvious warnings or errors.
Typically my workflow is something like this:
Get the backup and migrate module and use it to take a db snapshot, then import using mysql command line (or phpmyadmin). Sometimes the admin theme can be messed up, and it's because there's an entry in the db somewhere for some colors settings. I found that if you go to /admin/build/themes/settings/garland and just click on save the configuration it will correct the color/styling issues.
Good luck to you,
BK
Moving to a localhost
I made a copy of a experimental host last year and successfully installed it at the live site last year without much trouble. I don't remember how I copied the database, but it may have been from the command line with a command like this:
$ mysqldump -h database.url -u database.uid -pdatabase.password database.name >database.backup
Then ftp database.backup to your local host, use and restore it with something like this:
$ mysql -h database.url -u database.uid -pdatabase.password
mysql> create database database.name;
mysql> exit
$ mysql -h database.url -u database.uid -pdatabase.password database.name <database.backup
Next, use cpio to copy your Drupal installation:
On the original installation, change directory to the directory above your web root and execute the commands:
$ chmod u+w website.root/sites/default
$ find website.root -print | cpio -oBv >website.cpio
$ chmod u-w website.root/sites/default
Transfer website.cpio to your local host, change directory to the directory above your web root and restore it with:
$ cpio -iBvdum <website.cpio
$ chmod u-w website.root/sites/default
Finally, edit website.root/sites/default/php.settings and change db_url to contain the access information for the new database.
I'm pretty sure that's all that I did. The only other thing that I can think of is that the user id that you Apache is running under doesn't have access to all of the website files. If that's the case, change directory to the directory above the web root and use something like:
$ find website.root -exec chown apache.uid {} \;
Hope this helps,
Mike