I'd like to make a complete clone of my site on a local host so I can experiment with it.

Is there an easy way to do this? I've been trying and have been unsucessful. I've tried googling, but I only see tips for migrating the other direction.

Thanks.

Comments

DavidWhite’s picture

I would suggest following the standard procedure for migrating Drupal from 1 web server to another.

The gist of what you need to go is:
1) Take a MySQL backup (using mysqldump, if you have access to the command line, or using a tool like phpMyAdmin)
2) Import the database onto your own computer
3) Download all of the files with rsync, SFTP, SCP, FTP, or something similar
4) Edit settings.php (located in {drupal-root}/sites/default) to point to your new database on the localhost

Good luck,
David

mikeaja’s picture

There is some issue, though I can't quite figure out why, with this process, and possibly linked to the Fusion and / or Acquia Marina template (recommended / beta version).

I moved a site from hosted to local, changed the settings.php, very familiar with MySQL, but was left with an error page advising checking settings.php, although the admin side worked fine.

Turned out to be connected with Block settings. When going to the block page I saw they were all unset. Saving the Block config got site working, but all blocks unset of course. Not ideal. I suspect this is something to do with the template more than Drupal, but not sure.

maxxer’s picture

my understanding is that migrating from local to remote would follow pretty much the same protocol. A complete transfer of all files, a export/import of the database. And then telling drupal new access credentials for the database. Could you be a bit more specific with the kinds of problems you're getting?

xl_cheese’s picture

I was trying to export the database via phpmyadmin from the hosted site. Then on the local host I tried importing the database with phpmyadmin.

I just didn't quite know how to make the local site recognize the imported database. I think the previous poster gave me the right direction.

Thanks!

Would it make sense to make website changes/add content on a local host and then migrate to the server? Rather than adding content on the hosted site? Local sites move much faster.

rjdempsey’s picture

As long as you are the only one adding content to the site, (including commenting, etc.) it's safe to add content locally then export the database, import on the live site. Although the database import/export is a bit of a tedious process. If you're working locally and the content is being changed online by other users, be careful not to overwrite that content by swapping out databases.

I'd also look into the Backup and Migrate module. Very helpful. http://drupal.org/project/backup_migrate

xl_cheese’s picture

ugh, this is so frustrating. Nothing is working.

changingin the setting.php breaks the site.

The back up and migrate will create a back of of my live site, but does absolutly nothing when trying to restore that on my local site. I hit the restore button and the page just refreshes and doesn't do anything.

I've spent hours and hours trying to do this so I can experiment on a local host and not break my live site.

Does anyone else ever have the urge to hurl your computer against the wall?

Anonymous’s picture

There's always the Drupal Handbook: http://drupal.org/node/679054

This link provides detailed info on best practices for site migration.