0

Now have set up multi-sites is it possible to just cp database.sql to other databases so the site is duplicated but running independently?

I remember when I first set up multi-sites I got it wrong so that when changes were made to one database , it would translate to other until I separately created databases for each.

I know there are other ways of saving settings for a commonly created site in features which I have yet to try but isn't it easier to just copy the mysql over to other database and make small changes from there?

2

You can simply copy database all right, if you remember about critical points:

  • Make sure settings.php really points to proper databases
  • Before importing SQL file to new database, find and replace old URL and site name with new one.
  • If you keep any cache settings for external tools, like memcached, in database, make sure you either uninstall them before SQL export and then install again, or find & replace in SQL file before importing.
  • what do you mean find and replace URL and site name with new one? you mean in sites folder and in config file.. – cea Jul 4 '13 at 10:49
  • @CharlieBunt I mean in the very .sql dump file (uncompressed) – Mołot Jul 4 '13 at 11:01
  • @CharlieBunt PS usually if you need to have site name and url hardcoded in files other than settings.php it means something went wrong. Even in settings.php you usually can (and if can, should) avoid it. Database sand folder name in /sites hould be sufficient. – Mołot Jul 4 '13 at 11:18
  • WOW thanks Molot, I will have to go and research this now. – cea Jul 4 '13 at 15:10
  • just follow up, never found any url and site name in sql file, only the db name and tables info. – cea Aug 11 '13 at 5:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.