#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,650
    Rep Power
    171

    Connect to dedicated database from VPS and vise versa


    Hi;

    I got this client who has a some websites on a dedicated server and some on vps.

    Now the applicaiton I have made for him requires to connect from these databases together and share / update data!

    For example domain_mwa.com is on vps and needs to use the database of domain_thp.com which is on dedicated.

    How can I do this?

    If this is NOT posible what would be the solution?

    I bumped and posted in the wrong forum.

    Sorry a bit deseperate for this.

    Thanks
  2. #2
  3. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,095
    Rep Power
    1990
    You can allow MySQL connections through the firewalls on both servers (depending on just how the connections are required), set up a user on each MySQL server that allows remote connection from the second servers IP address and give it the appropriate permissions. Second option is to write an API for each one that can export the data that's needed.

    First option is the equivalent of a "quick and dirt hack", while the API option is definitely more future-proof and can be secured pretty easily (compared to leaving ports open on your firewall) as well as not requiring any sort of server changes. If you've got the time I'd suggest the API, but if not, you could open the ports until you can get a more robust solution.
  4. #3
  5. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,650
    Rep Power
    171
    Originally Posted by Catacaustic
    You can allow MySQL connections through the firewalls on both servers (depending on just how the connections are required), set up a user on each MySQL server that allows remote connection from the second servers IP address and give it the appropriate permissions. Second option is to write an API for each one that can export the data that's needed.

    First option is the equivalent of a "quick and dirt hack", while the API option is definitely more future-proof and can be secured pretty easily (compared to leaving ports open on your firewall) as well as not requiring any sort of server changes. If you've got the time I'd suggest the API, but if not, you could open the ports until you can get a more robust solution.
    Thank you.

    Do you know how I can move an account from VPS to dedicated? That suits me the most.

    Thanks
  6. #4
  7. Wiser? Not exactly.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    5,932
    Rep Power
    4033
    Ask whoever your host is to move your account. Or if you're changing hosts then you just need to setup the new dedicated server with all the files / db content then switch over your DNS.

    As a side note to the original question, one other possibility (that I've done before for small things) is setting up an SSH tunnel between the two servers for the mysql port. Does not require opening up the firewall, but it's still a rather poor solution.
    Recycle your old CD's, don't just trash them



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    51
    Rep Power
    2
    Originally Posted by English Breakfast Tea
    Thank you.

    Do you know how I can move an account from VPS to dedicated? That suits me the most.

    Thanks
    If you have a control panel such as CPanel on both servers that's going to be easy WHM has its feature to move websites across servers.

    Otherwise you have to manually move website's files,databases etc. from one server to the other and replace website's IP in its DNS zone.
    Last edited by freak.inside; September 19th, 2013 at 04:57 AM.
    All generalizations are false, including this one. Free hosting
  10. #6
  11. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,650
    Rep Power
    171
    Originally Posted by freak.inside
    If you have a control panel such as CPanel on both servers that's going to be easy WHM has its feature to move websites across servers.

    Otherwise you have to manually move website's files,databases etc. from one server to the other and replace website's IP in its DNS zone.
    The boss has heard somewhere that c panel uses a lot of resources and makes the system work slower or something like that so he refuses to instal c panel on dedicated.
    Considering we do not have a server admin guy, that is a pretty bad decision!
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    51
    Rep Power
    2
    Originally Posted by English Breakfast Tea
    The boss has heard somewhere that c panel uses a lot of resources and makes the system work slower or something like that so he refuses to instal c panel on dedicated.
    Considering we do not have a server admin guy, that is a pretty bad decision!
    That would have been a viable option only if it was already installed.
    I take it now it is not.
    You have to manually copy files, databases etc across then.
    I recommend lowering the TTL before starting the migration.
    Last edited by freak.inside; September 20th, 2013 at 12:54 AM.
    All generalizations are false, including this one. Free hosting

IMN logo majestic logo threadwatch logo seochat tools logo