linux backup suggestions

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
ugach
Posts: 34
Joined: Mon Oct 29, 2007 5:32 pm
Location: Walnut Creek CA

linux backup suggestions

Post by ugach » Wed Oct 14, 2009 12:08 am

I just built a Linux Server with raid 1. Got all opendentimages and mysql data moved. Then I looked at backup!

There is nothing wrong with current method. It works fine for windows machine. I have been able to backup and restore on home machine successfully. But, It seems that OD is just doing a file copy of images folder and mysql folder on windows machine. On Linux, I can backup opendentimages but what about the mysql database? Is it ok just to copy /var/lib--/whatever/--> mysql opendental database folder? Do I just create another samba share ponting to that folder? What happens to open files? On windows does OD actually lock the tables/stop service before making backup? Any linux mysql server users? What do you use for mysql database backup? Can you make any suggestions? I would prefer the backup to be as easy as current method for non-techie dentist.

murmsk
Posts: 177
Joined: Mon Jun 18, 2007 11:14 am
Location: Monmouth IL

Re: linux backup suggestions

Post by murmsk » Wed Oct 14, 2009 7:31 am

I use "mysqladmin" to do an automatic datadump several times a day which is stored on a different computer. This computer is also my backup server.

mysqladmin is a free downlad from mysql and will run on any flavor of machine (windows ,linux/apple)

We use karens replicator on a windows machine to move data between computers as it only moves new and changed files.

everyday the image files and datafiles are copied to the backup server, this along with a set of several editions of backedup data gets sent to an offsite backup.

steve
steve

User avatar
jordansparks
Site Admin
Posts: 5746
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: linux backup suggestions

Post by jordansparks » Wed Oct 14, 2009 9:20 am

Tables do not need to be locked before backing up. I did that for a few years, but then gradually stopped. I haven't locked tables for about 4 years now, and I have never had a corrupt backup. I restore backups very regularly to other machines. Never any problem. It's during the restore process that the mysql service must be stopped. So any old file copy strategy is just fine for backups.
Jordan Sparks, DMD
http://www.opendental.com

ugach
Posts: 34
Joined: Mon Oct 29, 2007 5:32 pm
Location: Walnut Creek CA

Re: linux backup suggestions

Post by ugach » Wed Oct 14, 2009 2:20 pm

murmsk wrote:I use "mysqladmin" to do an automatic datadump several times a day which is stored on a different computer. This computer is also my backup server.

mysqladmin is a free downlad from mysql and will run on any flavor of machine (windows ,linux/apple)

We use karens replicator on a windows machine to move data between computers as it only moves new and changed files.

everyday the image files and datafiles are copied to the backup server, this along with a set of several editions of backedup data gets sent to an offsite backup.

steve
Thank you Steve. You have given more ideas. karens replicator looks good too. I had seen mysqladmin briefly before. I did not know you could schedule a backup too. I am going to back up the database snapshots to shared opendentimages folder on the same server till end-of day and then copy the entire folder to external hard drive every night for off-site storage. Folder copy can be done by karens replicator and I am all set.

murmsk
Posts: 177
Joined: Mon Jun 18, 2007 11:14 am
Location: Monmouth IL

Re: linux backup suggestions

Post by murmsk » Mon Oct 19, 2009 1:17 pm

One thing about the datadump with mysqladmin.

If the database changes through a version change ie: new tables ...... you have to edit your backup schedule to include the new tables

it works well tho

steve
steve

ugach
Posts: 34
Joined: Mon Oct 29, 2007 5:32 pm
Location: Walnut Creek CA

Re: linux backup suggestions

Post by ugach » Mon Oct 19, 2009 1:35 pm

murmsk wrote:One thing about the datadump with mysqladmin.

If the database changes through a version change ie: new tables ...... you have to edit your backup schedule to include the new tables

it works well tho

steve
Thanks Steve,

I will keep database updates in mind. I also found free alternative to replicator. It is called cobian backup and it does file copy too. I just tried it on my test server and it looks good. I am also thinking about doing a database replication to a windows workstation. The current size of the database is approx. 30 MB so I can fit it in local drive. Any problems with that? I am not that worried about images folder and this will not be a backup to reverse changes. This would give me immediate fail-over for hardware failure and some time to make the hardware change.

murmsk
Posts: 177
Joined: Mon Jun 18, 2007 11:14 am
Location: Monmouth IL

Re: linux backup suggestions

Post by murmsk » Mon Oct 19, 2009 2:07 pm

Thats the beauty of open dental you can make any workstation act as a backup server. Just install mysql on it and turn off the service. backup the data whenever you want . If the main server goes to crap .... turn on the service and your up and running.

Some other ideas. You can rsync data home every nite ........ you would have to talk with Justin from Dentaltown for this one.

steve
steve

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: linux backup suggestions

Post by Justin Shafer » Tue Oct 20, 2009 2:04 am

ugach wrote:I just built a Linux Server with raid 1. Got all opendentimages and mysql data moved. Then I looked at backup!

There is nothing wrong with current method. It works fine for windows machine. I have been able to backup and restore on home machine successfully. But, It seems that OD is just doing a file copy of images folder and mysql folder on windows machine. On Linux, I can backup opendentimages but what about the mysql database? Is it ok just to copy /var/lib--/whatever/--> mysql opendental database folder? Do I just create another samba share ponting to that folder? What happens to open files? On windows does OD actually lock the tables/stop service before making backup? Any linux mysql server users? What do you use for mysql database backup? Can you make any suggestions? I would prefer the backup to be as easy as current method for non-techie dentist.
Be sure to either stop the mysql database before copying the files or just use mysqldump to dump the opendental database to a file.. Then be sure that file is on your backup media. Try udev if you want all your external drives to always have the same mount point no matter what.
mysqldump -u %mysqluser% -p%mysqlpassword% --all-databases >%workdir%\backup.sql

so you could say mysqldump -u root opendental > /media/usbdrive/OpenDental.sql

If you use mysqldump, it will include all the tables, and all the SQL statements to recreate the database....Go that route....
Backing up on a linux server can be tricky. There are many different ways to pull it off.... Out of all my clients I only maintain one linux server, for someone running Open Dental....
Highly recommend setting up udev if your going to rotate external drives on the server. That way the external drives will always have the same mount point on the filesystem.....

Also recommend backing up from ext3 to ext3... You can try to backup from say ext3 to fat32, but you can run into some problems with filenames.. As case sensitivity is different between the 2 filesystems....

If you want logging ability on the backups then thats a bit to setup as well........ I redirect the output of rsync to a file for this. For backing up over the internet I use Rsync as well.

----------------------------------------------

Linux is really cool but different to setup then a Windows box. I tell all my clients just to get Windows now. It makes life easier, and I like all my clients to have similar setups.

But I do manage one linux server running Open Dental and I do like it. I would say that if I had to do it all over again, I would probably tell him to go with Windows though. Linux requires some customizing to make right... But its not really that hard.
1. Samba.
2. MySQL
3. Webmin
4. Udev.
5. Cronjobs with Rsync.
6. Mono (to run Open Dental on the server)


$750 for Windows Server software for 5 users, and $250 for every 5 user after that.. Its not that expensive...

What do you guys think? To save $1000.00 you gotta do about $1000.00 of work. :mrgreen: If you perform ALL backups on a windows workstation then the Linux Server is a LOT easier to setup and maintain. I have my linux office doing this. Backup from server to workstation, then backup that workstation to the home pc... External drive rotation still done on the server.

So your left with a workstation that is ready to be a server, external drive backups, and a home pc that has a backup.

Linux for Clustering.. Now that is cool.
Last edited by Justin Shafer on Tue Oct 20, 2009 2:57 am, edited 3 times in total.

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: linux backup suggestions

Post by Justin Shafer » Tue Oct 20, 2009 2:23 am

I should start building some linux server that have all this done and then you guys can buy them... :P

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: linux backup suggestions

Post by Justin Shafer » Tue Oct 20, 2009 2:46 am

Remember that if you go with a linux server there is always, ALWAYS the disadvantage of...

A server is no good when it cant "serve" out the info to workstations. If the network switch goes down, then the server cannot talk to worstations.

At this point it becomes important to:
1. Replace network switch (no brainer)
2. Be able to run Open Dental on the server until network switch is replaced...

And that means messing with Mono and hope that your version of Open Dental will run okay on mono.

Windows users wont ever have this hassle. But Windows users cannot easily run a mysql-cluster.. Which to my knowledge zero dental offices are using.

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: linux backup suggestions

Post by Justin Shafer » Tue Oct 20, 2009 3:20 am

Here is a script to setup the workstation backup....

"c:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump" --host linuxserver --user root opendental > c:\data\opendental.sql
"c:\Program Files\MySQL\MySQL Server 5.1\bin\mysql" --host joeloftus-pc --user root opendental < c:\data\opendental.sql
xcopy z:\*.* c:\Data\ /d /e /c /y /i
EXIT

1. creates a backup file from the server to a workstation
2. restores the backup file to mysql running on the workstation
3. copies all the x-rays and files from samba to the workstation.
4. exit

I had some other stuff in the batch file but this is the jist of it.

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: linux backup suggestions

Post by Justin Shafer » Fri Oct 23, 2009 4:06 am

I guess I could throw VMWare Workstation on the server... that way I dont have to worry about mono running the latest version of Open Dental.... All for linux....

ugach
Posts: 34
Joined: Mon Oct 29, 2007 5:32 pm
Location: Walnut Creek CA

Re: linux backup suggestions

Post by ugach » Fri Oct 23, 2009 9:08 am

Justin Shafer wrote:I guess I could throw VMWare Workstation on the server... that way I dont have to worry about mono running the latest version of Open Dental.... All for linux....
Justin,

Thanks for the tips. I thought about that too but then realized that most of the manufactures for wireless cards, printers, scanners, imaging devices do not have drivers for Linux. I am not that comfortable passing on the USB port through Linux/VMWare on to window. I still have battle wounds from Nvidia, HPLIP, various wireless cards, SAMSUNG printer drivers, and worst of all, VIA chipsets. No complaints though. I now have really stable virus free, user safe workstations. I wish I could run Opdendental on Mono. Never had luck with that but if you do, let me open another thread and may be you can help me.

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: linux backup suggestions

Post by Justin Shafer » Sat Oct 31, 2009 11:20 am

I havent tried lately.. but OD has ran on Mono before... Search google for Open Dental and Mono...

Here were my directions for OD 5.something and Ubuntu 7.10.. I think... =) These commands compiled mono from source. The actual binary OpenDental.exe is compiled on visual studio.. so you should just be able to use the normal OpenDental.exe and run it without compiling Open Dental Source code with mono....

mono 1.9 ubuntu 7.10
apt-get install build-essential bison gawk
apt-get install libglib2.0-dev
apt-get install libpng12-dev libx11-dev libfontconfig1-dev
apt-get install libfreetype6-dev libjpeg62-dev libtiff4-dev
apt-get install libungif4-dev libexif-dev libcairo2-dev
apt-get install libpango1.0-dev libgtk2.0-dev libglade2-dev
apt-get install libgnome2-dev libgnomecanvas2-dev libgnomeui-dev
apt-get install libgnomeprint2.2-dev libgnomeprintui2.2-dev
apt-get install libpanel-applet2-dev libgtksourceview-dev
apt-get install libgtkhtml3.14-dev
wget http://go-mono.com/sources/libgdiplus/l ... .9.tar.bz2
tar xvf libgdiplus-1.9.tar.bz2
cd libgdiplus-1.9
./configure --prefix=/usr/local
make
make install
cd ..
wget http://go-mono.com/sources/mono/mono-1.9.tar.bz2
tar xvf mono-1.9.tar.bz2
cd mono-1.9
./configure --prefix=/usr/local
make
make install
cd ..
wget http://switch.dl.sourceforge.net/source ... src.tar.gz
tar xvf nant-0.86-beta1-src.tar.gz
cd nant-0.86-beta1
make install prefix=/usr/local
sudo sh -c "echo /usr/local/lib >> /etc/ld.so.conf"
sudo /sbin/ldconfig
export LC_ALL=en_us

mono /Somewhere/OpenDental.exe

ugach
Posts: 34
Joined: Mon Oct 29, 2007 5:32 pm
Location: Walnut Creek CA

Re: linux backup suggestions

Post by ugach » Mon Nov 02, 2009 11:17 am

Thanks Justin,

I will try compiling. I never had luck with precompiled windows executable. One time it would not take / for path so I could not use shared images folder on windows machine, these days it fails to start, complaining about cups printing (asking for it even though it is there).

Post Reply