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 backup question

Discussion in 'General Discussion' started by Scotty_B, Dec 20, 2005.

  1. Scotty_B

    Scotty_B Active Member

    Joined:
    Mar 1, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    In a hurry and not got time to go and look at the code / test it so asking here in case someone already knows.

    I want to create a database which will be used only as a search index for another database. The database itself will be many million rows, don't recall offhand, was something like 15-20 million rows. The problem is, MySQL dump takes forever whilst dumping these tables and as such I want to not back this database up.

    If I create this database manually (i.e. not through cPanel), will the cPanel backup feature ignore it and not back it up?

    Thanks
     
  2. parasane

    parasane Well-Known Member

    Joined:
    Oct 19, 2003
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Dickson City, Pennsylvania (USA)
    If you're doing it for a user account, so long as you preclude the database name with the account name and an underscore, cPanel will recognize that database as a part of the account property. Aside from that, cPanel will back up all databases, and doesn't care who created them or where or how they were done.

    So if you are doing it per-user and want to create the database for a user with the login michael, for a database with the name cars, and you're doing it from SSH, just access MySQL from the command line using your login credentials (with MySQL permissions) or root access (if root is granted access). From there, just type:

    CREATE DATABASE michael_cars;

    Then grant your permissions, et cetera, and create the tables using either the command line options or the MySQL client command line.

    After that, yes.... cPanel will back it up, no worries.

    ~ Dan
     
  3. Scotty_B

    Scotty_B Active Member

    Joined:
    Mar 1, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Damn, was hoping it wouldn't back it up.

    Maybe if I create a cPanel users and set the backup system to exclude that user it won't backup this database?
     
  4. parasane

    parasane Well-Known Member

    Joined:
    Oct 19, 2003
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Dickson City, Pennsylvania (USA)
    Actually, I just double-checked in WHM (WHM 10.0.0 cPanel 10.0.0-R112) and the MySQL backup allows the following configuration options:

    x Per Accounts Only
    x Per Accounts and Entire Mysql Dir
    x Mysql Dir Only

    So you could select Per Accounts Only and then name the database to a flat name (not associated with any account) and it will be skipped. Any other databases not associated with accounts will also be skipped, of course.

    There are other ways to work around this, but they'd be a bit more advanced.

    ~ Dan
     
  5. xisn

    xisn Well-Known Member

    Joined:
    Dec 4, 2004
    Messages:
    128
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Easy method

    I run something similiar on my database, I just created a dummy account in cPanel then removed it from the backup option:

    Backup >> Configure Backup >> Select Specific Users >> Save

    It does not get backed up..

    There may be better ways to do this I am sure!

    I have no need to backup this database as I only run the Queries once a week and dump the DB via CRON.
     
  6. Scotty_B

    Scotty_B Active Member

    Joined:
    Mar 1, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Sounds good, looks like I will be able to do exactly what I need without cPanel jumping in and doing what it wants.

    Pretty much exactly what I want. Nice to know it's possible :).
     
Loading...

Share This Page