In Progress Can't export database

Discussion in 'Free Hosting' started by theengli, Jul 29, 2020.

  1. theengli

    theengli Member

    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    Hi,
    I wanted to export my database and download it to my PC to create its backup before trying to upgrade my moodle website, but I can't.
    My database is about 290 Mb, but only a small sql file gets downloaded, and it's empty. Is it because my database is too big? How can I download its backup? Or can perhaps an admin export it for me?
    I'm afraid to make any significant changes without a database backup.
     
  2. garrettroyce

    garrettroyce Community Support Community Support

    Messages:
    4,912
    Likes Received:
    170
    Trophy Points:
    63
    You can get it here (this is only for your server; other users have to choose their own server):

    https://x13.x10hosting.com/phpMyAdmin/server_export.php?lang=en

    Make sure to choose data and structure; if you do structure only, you'll get a small file. You have to increase the file size over 50k lines as well.

    However, if this backup takes a long time, PHP will time out, or you will hit a resource limit. Consider dumping large tables individually instead of an entire DB.

    If that doesn't work, I'll see if I can get an admin. Generally, they don't do this, but I can't speak for them.
     
  3. theengli

    theengli Member

    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    Hi,
    I used your link and managed to download a gz file. Is it OK that it's only 8.8 Mb while my DB is about 290 MB? Or did it time out while downloading?
     
  4. garrettroyce

    garrettroyce Community Support Community Support

    Messages:
    4,912
    Likes Received:
    170
    Trophy Points:
    63
    It probably timed out. Unless your database is literally the exact same data over and over again, it wouldn't compress down that far.
     
  5. theengli

    theengli Member

    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    Is there any way to find out for sure? I can't proceed without a backup.
     
  6. theengli

    theengli Member

    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    I'd like to try that, too, but I don't know how. Can you point me in the right direction on how to do it?
     
  7. garrettroyce

    garrettroyce Community Support Community Support

    Messages:
    4,912
    Likes Received:
    170
    Trophy Points:
    63
  8. theengli

    theengli Member

    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    Sorry for this absolutely idiotic question, but what do ppl do with such scripts? Do I need to copy and insert it somewhere in the DA panel? create some file with it and upload it to the hosting? somehow insert it somewhere on phpMyAdmin?
     
  9. theengli

    theengli Member

    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    I did this:
    and set it to 50 000. Then I followed your link from here:
    and exported my DB again. This time it was even smaller - 6.99 MB than the previous time (8.75 MB).
    Did it timeout again?
     
  10. garrettroyce

    garrettroyce Community Support Community Support

    Messages:
    4,912
    Likes Received:
    170
    Trophy Points:
    63
    The instructions for the script are inside of it. It wants you to write a single line of code. Make a new file like this:

    Code:
    <?php
    include('my-sql-export.php');
    
    EXPORT_DATABASE("localhost","user","pass","db_name" );
    ?>
    Save the file from the link to your computer and name it my-sql-export.php. Then upload it to your account inside of the public_html folder for your website. Create a new file in DA, call it backup.php, and put the above code in it. Then go to yoursite.example/backup.php.

    Remove these files or password protect them immediately. Anyone who knows the file name can access your backups.
     

Share This Page