2

I'm planing to migrate my live site from the current shared host to another shared host. I'm thinking to use Backup and Migrate module or importing/exporting mysql by phpmyadmin.

However I'm concerning about the new users who register on my site and their content profile node. Because on both old and new host users will be registered for some while (maybe 2 weeks?). And in this period there probably will be duplicated User ID and Node ID with different data on both hosts.

Is there any way to prevent this or synchronize both old and new site for some time?
Or is it safe to import eventually the data of discrepancy from the old one to the new one just changing uid and nid after name server propagation is completed?

  • I just came up with an idea. What about if I change the setting.php in the old server like this $db_url='old mysql server' to $db_url='new mysql server'? Then whatever change will be done in the new server I suppose. Does this work?? – chinita7 Apr 4 '12 at 18:27
0

if i get it right, you are afraid it would get 2 weeks for people (or their computers) to notice the change of DNS ? (is that the only reason for running two sites in paralel ?). That shouldnt be necessary. You should be able to set the TTL (time to live) on your current DNS records and then (after some time - 24hours minimum) change it to the new IP adress and it shouldnt take more than a day for everyone to realise. (see http://www.dnswatch.info/articles/dns-update - other records).

Anyway, if you still think you want people to work on 2 sites :). You could setup the next value for the ID on the important tables (node, user, comment, file ?),

 ALTER TABLE tbl AUTO_INCREMENT = 100;

probably on the new database so that it would be possible to merge the two databases afterwards. But it still is quite complicated - you cant just use backup migrate - you cant replace the databse, you have to MERGE it.

Probably something like deploy could be of help, but rather harder to set up if its just for the few days.

  • The reason I would run the site on two server is that I thought it would take up to 2 weeks until DNS change is done completely because of the DNS cach. But if 24 hours is enough ideally I will just set TTL on my current DNS recored as you mentioned. As soon as possible I need to close the old one and just use the new one. Changing important ID by sql before merge it might work though I have no experience with that. So then I suppose I need to put AUTO_INCREMENT somewhere in node module and user module? – chinita7 Apr 3 '12 at 6:00
  • i think the best to do is to avoid the need to merging the databases :). Should you want to set the auto increment , its just done once by running that command - basicly mysql stores the next id value and you would tell it to use a higher one, "move it forward". – mojzis Apr 3 '12 at 7:37
1

I think you're on the right track. It is nearly impossible to implement a migration project and not plan for incremental updates. The migrate module supports that with its "update" function (as shown in the screen shot).

That said, there shouldn't be a problem of duplicate UIDs after the initial migration of data, unless you are letting people create accounts on both the legacy system and the new instance.

enter image description here

  • Is that screenshot from Backup and Migrate or Migrate? @chinita7 mentioned Backup and Migrate, but it sounds like you are recommending Migrate an an alternative solution. – mpdonadio Apr 2 '12 at 22:58
1

I might be way off here, but since we know that DNS update takes only up to 24 hours at most, why not just put an upgrade notice on the old site and disable new content and user creation for a couple of hours while the migration is progressing?

0

Create and import the database in the new server, Use this db from the shared hosting changing the data in setting.php so all the new changes will be in one database. Then you change the dns for your domain name and should be ok. Or do the opposite: leave the db in the shared hosting and use it from the new server, then put the website offline for 5 minutes and import the new database.

Be careful because you will work with one db, and the changes will affect both website.

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.