Moving Databases Without Root Access

Discussion in 'Domains, Hosting and Servers' started by Trip, Feb 5, 2010.

  1. Trip

    Trip Novice

    Joined:
    Jan 4, 2010
    Messages:
    30
    Likes Received:
    2
    Currently on I am a shared hosting plan and soon I will be moving to a VPS. I need to move my database, which I have never attempted before. I don't have root access on the shared plan. I was planning on calling my host and asking them too SSH my db and make it available for me to download. Not sure if that will fly or not. Is there any other work around to move databases? I read somewhere people were having good luck with mysqldumper. Any recommendations on the best way to move a database without root access?
     
  2. Abomination

    Abomination Zealot

    Joined:
    Jun 1, 2009
    Messages:
    1,514
    Likes Received:
    102
    When we were on a shared server I would use puTTY to log in via SSH, then run a couple of commands, which would create a file with the .sql extension. Then used ftp to download that file.


    To back up the database:
    mysqldump --opt -Q -u dbusername -p databasename > backupname.sql

    To restore that back up:
    mysql -u dbusername -p databasename < backupname.sql


    Yes I tested that method of backup. Some shared hosts need to enable SSH.

    Once you have everything backed up, you may want to let your vps provider move the account anyway, that will bring over everything including the emails. At least that is how it worked for us.
     
  3. bucket

    bucket Addict

    Joined:
    Nov 16, 2009
    Messages:
    110
    Likes Received:
    18
    how large a database is it?
     
  4. Trip

    Trip Novice

    Joined:
    Jan 4, 2010
    Messages:
    30
    Likes Received:
    2
    I believe it's somewhere around 30-40meg? I tried grabbing it off phpmyadmin and it timed out.
     
  5. Abomination

    Abomination Zealot

    Joined:
    Jun 1, 2009
    Messages:
    1,514
    Likes Received:
    102
    I had no problem using the method I posted, 400+MB database.
     
  6. Trip

    Trip Novice

    Joined:
    Jan 4, 2010
    Messages:
    30
    Likes Received:
    2
    Not sure I follow you 100% bro. I was under the impression the putty client was used when you have root access to your server for communicating via SSH/telenet??
     
  7. Abomination

    Abomination Zealot

    Joined:
    Jun 1, 2009
    Messages:
    1,514
    Likes Received:
    102
    We used hostgator. They had something called 'jailed' shell access. They enabled that on my account.

    When starting cPanel, it asks for a user name and password.

    When I started puTTY, I entered the same login username and password.

    Then I used the command in my first post in this thread to make a backup file of the database. That is the only 'official' method vb endorses to make a backup.

    Could you ask your host about getting some type of shell access? It does not have anything to do with root access as far as I can tell, you only see the same types of things as you would in the file manager in the cPanel.
     
  8. Trip

    Trip Novice

    Joined:
    Jan 4, 2010
    Messages:
    30
    Likes Received:
    2
    I see what you are saying now. When I called my host they weren't exicted about helping me out. Probably because I have plans to move and from their point of view, I can half understand why.
     
  9. Abomination

    Abomination Zealot

    Joined:
    Jun 1, 2009
    Messages:
    1,514
    Likes Received:
    102
    Just tell them you are being a careful forum admin, and want to make an off site back up. They should understand that. If they are being difficult I would quickly try to get away from them.


    When we moved to a vps the new vps provider actually moved the entire site over from the shared hosting account. Everything, including emails. You could ask your new vps provider if they will do that, and if shell access is necessary for that to happen.

    Whatever happens, let us know how it turns out. : )
     
  10. Trip

    Trip Novice

    Joined:
    Jan 4, 2010
    Messages:
    30
    Likes Received:
    2
    Got it all sorted. Piece of cake.
    Thanks for the help Abomination, I appreciate it :cool:
     
  11. bucket

    bucket Addict

    Joined:
    Nov 16, 2009
    Messages:
    110
    Likes Received:
    18
    good that it was sorted.

    but how?
     
  12. Trip

    Trip Novice

    Joined:
    Jan 4, 2010
    Messages:
    30
    Likes Received:
    2
    I just asked my new host to move it. "Sure, we do it all the time" 1/2 hour later it was done.
     

Share This Page