Make an osTicket Database Backup



  • osTicket uses MariaDB (or MySQL) as its database. Taking a database backup is quick and easy and totally standard to the MariaDB platform. But for those not familiar, this command will take care of you.

    mysqldump ost_database_name -uyouruser -pyourpassword --single-transaction --quick --lock-tables=false > /tmp/osticket-backup-$(date +%F).sql
    

    In this example you will need to add your database credentials, of course. And it only takes the backup to the /tmp directory. So either use that as a temporary scratch space before shipping the backup elsewhere, or change the target location.



  • @scottalanmiller said in Make an osTicket Database Backup:

    osTicket uses MariaDB (or MySQL) as its database. Taking a database backup is quick and easy and totally standard to the MariaDB platform. But for those not familiar, this command will take care of you.

    mysqldump ost_database_name -uyouruser -pyourpassword --single-transaction --quick --lock-tables=false > /tmp/osticket-backup-$(date +%F).sql
    

    In this example you will need to add your database credentials, of course. And it only takes the backup to the /tmp directory. So either use that as a temporary scratch space before shipping the backup elsewhere, or change the target location.

    I have never used OST Ticket but is those single transaction and other database commands necessary rather than normal mysqldump ?



  • @dbeato said in Make an osTicket Database Backup:

    @scottalanmiller said in Make an osTicket Database Backup:

    osTicket uses MariaDB (or MySQL) as its database. Taking a database backup is quick and easy and totally standard to the MariaDB platform. But for those not familiar, this command will take care of you.

    mysqldump ost_database_name -uyouruser -pyourpassword --single-transaction --quick --lock-tables=false > /tmp/osticket-backup-$(date +%F).sql
    

    In this example you will need to add your database credentials, of course. And it only takes the backup to the /tmp directory. So either use that as a temporary scratch space before shipping the backup elsewhere, or change the target location.

    I have never used OST Ticket but is those single transaction and other database commands necessary rather than normal mysqldump ?

    Umm, that is a normal command. What is the problem here.



  • @JaredBusch said in Make an osTicket Database Backup:

    @dbeato said in Make an osTicket Database Backup:

    @scottalanmiller said in Make an osTicket Database Backup:

    osTicket uses MariaDB (or MySQL) as its database. Taking a database backup is quick and easy and totally standard to the MariaDB platform. But for those not familiar, this command will take care of you.

    mysqldump ost_database_name -uyouruser -pyourpassword --single-transaction --quick --lock-tables=false > /tmp/osticket-backup-$(date +%F).sql
    

    In this example you will need to add your database credentials, of course. And it only takes the backup to the /tmp directory. So either use that as a temporary scratch space before shipping the backup elsewhere, or change the target location.

    I have never used OST Ticket but is those single transaction and other database commands necessary rather than normal mysqldump ?

    Umm, that is a normal command. What is the problem here.

    I am terrible at explaining, but specifically, what I was trying to ask is what is the difference between running a mysqldump without any flags besides the username password and mysql host if neccessary. I am more talking about this part:

    --single-transaction --quick --lock-tables=false
    


  • @dbeato said in Make an osTicket Database Backup:

    @JaredBusch said in Make an osTicket Database Backup:

    @dbeato said in Make an osTicket Database Backup:

    @scottalanmiller said in Make an osTicket Database Backup:

    osTicket uses MariaDB (or MySQL) as its database. Taking a database backup is quick and easy and totally standard to the MariaDB platform. But for those not familiar, this command will take care of you.

    mysqldump ost_database_name -uyouruser -pyourpassword --single-transaction --quick --lock-tables=false > /tmp/osticket-backup-$(date +%F).sql
    

    In this example you will need to add your database credentials, of course. And it only takes the backup to the /tmp directory. So either use that as a temporary scratch space before shipping the backup elsewhere, or change the target location.

    I have never used OST Ticket but is those single transaction and other database commands necessary rather than normal mysqldump ?

    Umm, that is a normal command. What is the problem here.

    I am terrible at explaining, but specifically, what I was trying to ask is what is the difference between running a mysqldump without any flags besides the username password and mysql host if neccessary. I am more talking about this part:

    --single-transaction --quick --lock-tables=false
    

    The single transaction flag initiates a MySQL transaction which makes it more efficient because it does not lock the entire database.



  • osTicket uses InnoDB, so this is the command for that. If we were using MyISAM, we'd not want this command.



  • Total DB Admin noob here - so bare with me.

    Does this include the username/password setup for this DB? or does that need to be maintained separately?

    i.e. you have to rebuild from this backup - do you just create a brand new SQL user and grant them rights to this DB upon import, then use that new account to give access to the app?

    In typing out my question I kinda assume the answer is the second bit - you just create a new user and assign them rights.



  • @Dashrender said in Make an osTicket Database Backup:

    Total DB Admin noob here - so bare with me.

    Does this include the username/password setup for this DB? or does that need to be maintained separately?

    i.e. you have to rebuild from this backup - do you just create a brand new SQL user and grant them rights to this DB upon import, then use that new account to give access to the app?

    In typing out my question I kinda assume the answer is the second bit - you just create a new user and assign them rights.

    Correct. The user and the database are separate things.