1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help with transfer from one VPS to another

Discussion in 'Server Configuration and Hosting' started by AT8500, Jan 12, 2014.

  1. AT8500

    AT8500 Member

    I am planning to transfer my whole site including xenForo forumu from curent VPS to new one. Now my plan is to first setup everyting on new server and then just to change DNS of my domain to poin to my new server but I have few questions and hoping you could help me a little:

    1) On new server should I install xenForo from installation folder or should I just transfer whole xenForo folder (via SSH) from OLD server to NEW server?

    2) Because my domain will still point to OLD server for next few days will I be able to test everything on new server just by using VPS IP address (because I heard that you can access your site via IP if you use Cpanel), or maybe to register some cheapest domain just for this testing. I want to setup everything and test before going live with new server

    3) Any sugesstions that you have in case of such transfer
  2. Sheratan

    Sheratan Well-Known Member

    Is the old and new vps using cpanel? If yes I believe you can transfer the whole site and database via WHM.

    And yes, you can access your site via IP address. But dont forget to htpasswd the site during the test.
  3. WSWD

    WSWD Well-Known Member

    If you're using cPanel, use the transfer tools there (WHM). It is incredibly simple and will replicate the site on the new server exactly as it is on the old.

    Depends. Some things just have a heck of a time working on IP addresses. WordPress is one of those things. Some sites work, some don't.
  4. AT8500

    AT8500 Member

    Tnx for your answers ;)

    My current VPS is not using Cpanel (I am using kloxo), but new one will be with CPanel

    I will probably just transfer files and when everything is ready to go import database. But still not sure should I transfer xenForo folder from current VPS to new VPS or should I install fresh instalation of xenForo on new VPS and then set up again everything. I think first option is beter (just copy/paste folder from one server to another via SSH).

    Also will I be able to test all forum options just with IP address (like file premissions, basic functionality, etc...)

    I only use xenForo from third party software, portal and other things are my custom scripts and I will manage it easy.
  5. SneakyDave

    SneakyDave Well-Known Member

    I don't know about cpanel, but you can change your PC's hosts file so that it thinks your new site is hosted at your new IP's address. That way, you can test everything before your site actually moves to the new server.
    If you're on windows, your hosts file may be located in C:\Windows\System32\drivers\etc

    It's called "hosts" obviously, add a line to the bottom of it that looks like this, change the IP to your new IP, and the site name to your site's domain name.
    Code:  yoursitename.com
    Save the file (you might have to edit the file as an administrator on Windows 7 or Windows 8), and then when you load your site up in a browser, you should see your site on the new server.

    More info on host file changes:

    I usually try to make sure that after DNS is updated, pointing your site to the new server, to remove the hosts entry in order to prevent problems if your site moves again in the future.
  6. AT8500

    AT8500 Member

    If I understood you correctly if I change host file to 111.222.333.444 myDomain.com, if I enter myDomain.com in my web browser it will point to IP. That is helpful but would it means just that I don't have to enter IP address in web browser and nothing else because server side scripts still would see only IP as default?

    Also now I start to think that I will probably not be able to test anything without working domain, because forum would still look for it in every call and all I have would be IP.
    Would it be stupid to buy some cheapest domain and set it as forums default domain, test everything with it and when I am ready to go live just change it to my main domain in xenForo control panel?

    In last month I had catastrophic database problem and forum was unavailable for 7 days, also I lost 6 months of data. I am changing my VPS because of that but can't afford to have forum not working again after I change server because members are allready angry. That is why I am maybe complicating about this and need to be sure of every step before I do it.
  7. SneakyDave

    SneakyDave Well-Known Member

    Make sure you make backups of your xf installation and your database, and keep them in a safe place.

    Is your database on the same server as your old/current site? You'd want to copy that database to a new database on the new server, and use that MySQL configuration for your new server. Don't share the same database between your old xF installation and the new one.

    Then when all your testing was done, do another copy of your old/current database to the new (emptied) database.

    If you leave your site name as the board URL in your xenforo acp, and change your host file, most things should work. I've noticed some add-ons/crons may not work 100% because they will try to ping your site pointing to the original IP address, but there's probably nothing you can do about that until you change your DNS.

    If you can add sub-domains in cpanel, you can setup a temporary http://new.yoursitename.com subdomain, pointing that subdomain to your new IP address, and test it out there. Again, make sure to use a different database for your testing.
  8. AT8500

    AT8500 Member

    OK, if that thing with host file really work than it would be perfect.

    Databse that would be used for testing is not same as one that is use on "live" version of forum. They are not on same server. I will just export all tables and import them on new server. Then would test with those data (I don't care if they get old because it is just test). Then when everything is ready I will lock "live" forum and export tables again. Import them on new server and then change DNS. After that only working version of forum would be one on the new server so as DNS propagation is done user would be able to use it.
    SneakyDave likes this.
  9. AT8500

    AT8500 Member

    I need one more think to ask.

    I have transfered whole xenForo directory and test database to new VPS, tested it and everything is working fine. I did this transfer 7 days ago, so in few days I plan to switch to new VPS, but just now I figure it out that beside importing database , I would have to import also all attacments that have been posted on forum in period of 7 days after I initialy transfered whole xenForo folder (so every new attachment form that point until now)

    So my question is:
    Is it possible to transfer only new files (from current active server to new one) or maybe only files that are not on server right now instead of overwriting whole directory. I would like to use SSH but don't know correct command for that. If such thing is not possible then I would have to overwrite everything or at least directories in which new attachments are.

    Additional to above, what folders I should transfer to make sure that all new attachments are on new server too. I guess /internal_data/attachments but there are lot of subfolders with numbers (0,1,2,3,...35)
  10. Brogan

    Brogan XenForo Moderator Staff Member

    You won't know which attachments have been changed - it could be any or all of those directories which have changed contents.

    Same for the avatars.

    So you will need to synch the /data and /internal_data directories completely.
  11. AT8500

    AT8500 Member

    Tnx, so is this correct SSH command to do update of data directory (same goes for internal_data):

    Is there need to add something as --ignore-existing or other flags. For my intial transfer I used scp command so basically in above command I just changed scp to rsync and maybe there should be some additional flags or something.

    I know that this is not XenForo specific question but I would be very grateful if someone could help me with exact command so I can do this as fast as possible.

Share This Page