The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Database .gz Backups to .sql Restores

Discussion in 'General Discussion' started by Ver17, Jun 19, 2007.

  1. Ver17

    Ver17 Active Member

    Joined:
    Jun 9, 2004
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    I have backed up an accounts databases to help a client move to a new provider. The new provider does not use cPanel and asked me to upload the database as an SQL file.

    When I extract the cPanel backup gz file, the database file inside does not have a file extension type as all and is only listed as a 'File'. It only has the first half of the file name not the file type/extension.

    My question is.... can I simply add the .sql extension on this database or did cPanel change anything when it made the backup as a .gz file? Was it not really saved as a SQL file?

    Thank you for any help you can provide :)
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    In windows explorer, folder options, View tab, find "Hide extensions for known file types" uncheck that.

    The cPanel backup does leave the file extension there. I just checked one of mine. ;)
     
  3. Ver17

    Ver17 Active Member

    Joined:
    Jun 9, 2004
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    No no no.... its not that simple.... thats amature hour :)

    I have talked to other IT guys at work and showed them the mystry file with no file type and they scratched their heads too.
     
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I would follow what Infopro suggested.

    File extensions are really a Windows thing. An SQL dump file, as they are called, is really nothing more than just a text file filled with the necessary database queries to reconstruct the database. It really doesn't matter what the file extension is. It can be .sql or .txt or something else. The other server administrators would just feed this file to their MySQL server, with the necessary database name, and the database would be reconstructed from the dump file.

    The cPanel backup should name the file with a .sql extension and it is likely that your Windows explorer shell is hiding the file extension. Again, it doesn't really matter what the extension is. The administrators of the other server really should be able to use it, assuming its a proper SQL dump.
     
  5. arhs

    arhs Well-Known Member

    Joined:
    Jul 4, 2003
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    16
    You can unzip the database backup file as following:

    gunzip database.gz

    mv database database.sql

    Then restore the database via phpMyAdmin or SSH.
     
  6. Ver17

    Ver17 Active Member

    Joined:
    Jun 9, 2004
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Thats the info I needed... thanks all....

    BTW, I don't think I was really understood before. I could add any type of file extension on to the end of the file manaully, in which case I could then see the file extension with all the other files/extensions in the folder (hide file extensions is and was turned off) and when I changed the extension manaully the icon would change coresponding to the type of file assosiation connected to the file type. My question was more on the lines of if I could simply manaully change the file type to SQL which was answered. Thanks again.
     
Loading...

Share This Page