DashBox Database Backup

ben
Site Admin
Posts: 4259
Joined: Fri Jun 04, 2010 9:39 am

DashBox Database Backup

Post by ben » Tue Jul 19, 2016 1:58 pm

Versions
V1.3
- Changed export format to plain formatting to provide compatibility across PostgreSQL versions.

V1.2
- Added exclude System Tables option.
- Added exclude Old Minute table option (this is only for customers with data before May 2015).

The old_minute table contains all data before minute tables were partitioned. It can take a long time to restore depending on the size. It's suggested that this table is exported separately, and it only needs to be exported once as it doesn't change.

V1.1
- Initial Version

DashBox Settings

A password must be setup for the Backup to operate. This password can be set in the DashBox Settings area.

Under DashBox Settings:
- System -> Backup Settings


Windows Users

The program is available here:
https://www.brultech.com/software/files/getsoft/1/4

Requirements

- Java Run-Time Engine (JRE) (http://www.java.com/).
- 600MB per 16GB of data (per backup).

How-to Run

The DashBox backup program is a program written in Java. No installation is required, the only requirement is JRE (as listed above). To run the program:

- Extract the full zip file to any folder.
- Double-click the JAR file.

The backup program will create a backup.bat file in the folder it's located in and automatically run this file. For future backups, you can just run the .bat file it creates.

The bat file can also be automated via a Windows Task. It'll automatically timestamp the file.

Windows 10 Automated Backups

In the example below, we'll be setting up a task that will backup the DashBox twice a week.

- Right-click on the Start Menu and go to Settings.
- Type in Task Scheduler into the Search Box.
- Click "Create Basic Task" in the left menu.
createtask.png
createtask.png (37.8 KiB) Viewed 15578 times
- Give the task a name and description and click Next.
taskname.png
taskname.png (12.49 KiB) Viewed 15578 times
- Select weekly from the list of backup ranges and click Next.
taskdate.png
taskdate.png (11.8 KiB) Viewed 15578 times
- The below settings will backup every Tuesday and Friday at noon. Click Next afterwards.
taskdatetime.png
taskdatetime.png (12.43 KiB) Viewed 15578 times
- Leave the task setting as program and click Next.
taskaction.png
taskaction.png (10.28 KiB) Viewed 15578 times
- Move the backup program to somewhere easily accessible. The settings you need will be similar to the image below. You'll replace C:\DashBoxBackups\ with whatever folder you're using to store the backups. The "Add Arguments" field is below. Click Next when finished.

Code: Select all

/c start /min C:\DashBoxBackups\backup.bat ^& exit
taskcmd.png
taskcmd.png (10.88 KiB) Viewed 15578 times
- The last screen will give you an overview of what you've created, just click finish when done.
taskfinish.png
taskfinish.png (16.66 KiB) Viewed 15578 times
- When the backup runs, it'll pop up for a second then minimize and run in the background. It shouldn't take much resources to run. As long as the window isn't closed, the backup will be completed successfully.




Linux/Mac Users

The DashBox is running a PostgreSQL 9.1 database. You can try to install via a package manager (apt, etc) if you can find a version of 9.1. If not, you can pick up a copy of the pg_dump binaries here: https://www.enterprisedb.com/download-p ... l-binaries. Using -Fp however should allow dumps to be restored across PostgreSQL version (-Fp outputs plain SQL), -Z6 adds compression to these archives.

The dump command is as follows:

Code: Select all

pg_dump -Fp -Z6 -x -O -h <dashbox ip> -U dbbackup -f backup.gz brultech_dash
To automate you'll want to create a .pgpass file in the home directory of the user that looks as follows:

Code: Select all

<dashbox ip>:5432:brultech_dash:dbbackup:<password>
You'll also need to set its permissions

Code: Select all

chmod 600 ~/.pgpass
Ben
Brultech Research Inc.
E: ben(at)brultech.com
SirMaple
Posts: 70
Joined: Sat Aug 08, 2015 11:37 pm
Location: Canada

Re: DashBox Database Backup

Post by SirMaple » Wed Aug 31, 2016 3:36 pm

Would it be possible to get a Linux version?

Would be great to have this run on a crontab weekly.
ben
Site Admin
Posts: 4259
Joined: Fri Jun 04, 2010 9:39 am

Re: DashBox Database Backup

Post by ben » Thu Sep 01, 2016 9:29 am

EDIT: Old information removed.
Ben
Brultech Research Inc.
E: ben(at)brultech.com
ben
Site Admin
Posts: 4259
Joined: Fri Jun 04, 2010 9:39 am

Re: DashBox Database Backup V1.1

Post by ben » Tue Aug 08, 2017 4:13 pm

Updated with new method.
Ben
Brultech Research Inc.
E: ben(at)brultech.com
johnstonf
Posts: 131
Joined: Mon Aug 08, 2016 10:03 am

Re: DashBox Database Backup V1.1

Post by johnstonf » Tue Oct 17, 2017 1:47 pm

Screen Shot 2017-10-17 at 4.25.11 PM.png
Screen Shot 2017-10-17 at 4.25.11 PM.png (520.07 KiB) Viewed 15597 times
I "just" upgraded my DashBox to latest v4.2.3c9k.
I then run latest DashBox Database Backup v1.1, and it specifically says:
"Requires DashBox 4.2.3d or higher"
what??!! (I'm serious, it REALLY DOES!)
(I attached a photo, cause i thought my eyes were decieving me)

Help!
Last edited by johnstonf on Tue Oct 17, 2017 3:26 pm, edited 1 time in total.
Teken
Posts: 2700
Joined: Wed Dec 15, 2010 4:09 pm
Location: The Bad Lands

Re: DashBox Database Backup V1.1

Post by Teken » Tue Oct 17, 2017 2:04 pm

Hello Fred,

Does the back up process work as intended? Or are you simply worried about the notification on the top?
Teken . . .

My ongoing projects thread: http://www.brultech.com/community/viewt ... ?f=2&t=929
Buy me a cup of coffee: https://www.paypal.me/Teken https://gfinotify.com/ Discount Code: PC10
johnstonf
Posts: 131
Joined: Mon Aug 08, 2016 10:03 am

Re: DashBox Database Backup V1.1

Post by johnstonf » Tue Oct 17, 2017 3:27 pm

I don't want to proceed with the ominous message...
First time trying to get a backup.
/f
Teken
Posts: 2700
Joined: Wed Dec 15, 2010 4:09 pm
Location: The Bad Lands

Re: DashBox Database Backup V1.1

Post by Teken » Tue Oct 17, 2017 3:28 pm

johnstonf wrote:I don't want to proceed with the ominous message...
First time trying to get a backup.
/f
You will be fine ~ Go for it! :mrgreen:
Teken . . .

My ongoing projects thread: http://www.brultech.com/community/viewt ... ?f=2&t=929
Buy me a cup of coffee: https://www.paypal.me/Teken https://gfinotify.com/ Discount Code: PC10
johnstonf
Posts: 131
Joined: Mon Aug 08, 2016 10:03 am

Re: DashBox Database Backup V1.1

Post by johnstonf » Tue Oct 17, 2017 3:36 pm

Sounds like I'm missing a version update somewhere.
Don't want backup to be incompatible with restore.
You don't really get to verify that the backup is good.


Teken wrote:
johnstonf wrote:I don't want to proceed with the ominous message...
First time trying to get a backup.
/f
You will be fine ~ Go for it! :mrgreen:
Teken
Posts: 2700
Joined: Wed Dec 15, 2010 4:09 pm
Location: The Bad Lands

Re: DashBox Database Backup V1.1

Post by Teken » Tue Oct 17, 2017 3:39 pm

johnstonf wrote:Sounds like I'm missing a version update somewhere.
Don't want backup to be incompatible with restore.
You don't really get to verify that the backup is good.


Teken wrote:
johnstonf wrote:I don't want to proceed with the ominous message...
First time trying to get a backup.
/f
You will be fine ~ Go for it! :mrgreen:
You're not missing anything the back up software was released some time ago. But the Dash Box firmware naming schema has changed a little so the message at the top is not relevant. You currently only have the ability to make a back up there is no user ability to restore the same.

This is being worked on . . .
Teken . . .

My ongoing projects thread: http://www.brultech.com/community/viewt ... ?f=2&t=929
Buy me a cup of coffee: https://www.paypal.me/Teken https://gfinotify.com/ Discount Code: PC10
Post Reply