Page 1 of 2

Database Transfer-Solved

Posted: 18 Jan 2017, 15:55
by vvon66
Hi - New user here. I want to install opencats on a windows system and use it for a month or so to test it out. My question is...if I want to setup opencats on a server later, is it possible to transfer the database so that I do not lose my information? What would be the process to do that? Could I just copy the database to the server?
Thank you!

Re: Database Transfer

Posted: 18 Jan 2017, 16:49
by vvon66
I just installed opencats on my windows system. It worked perfectly!!! I followed the instructions and they were wonderfully written. Kudos to the authors of the tutorial!

Re: Database Transfer

Posted: 18 Jan 2017, 18:14
by cptr13
Thanks. Yes you can transfer from one environment to another. I'm hoping to do documentation on that process soon. If you get ready and it's not done yet, just request help on these forums and someone will walk you through it

Re: Database Transfer

Posted: 18 Jan 2017, 18:42
by vvon66
cptr13 wrote:Thanks. Yes you can transfer from one environment to another. I'm hoping to do documentation on that process soon. If you get ready and it's not done yet, just request help on these forums and someone will walk you through it
Thank you for the quick reply!

Re: Database Transfer

Posted: 19 Jan 2017, 13:20
by RussH
vvon66 wrote:Hi - New user here. I want to install opencats on a windows system and use it for a month or so to test it out. My question is...if I want to setup opencats on a server later, is it possible to transfer the database so that I do not lose my information? What would be the process to do that? Could I just copy the database to the server?
Thank you!
Super-simple if you're happy with a little command-line action.

on your source server, login as a user (don't need root) and backup the mysql database;
Code: Select all
mysqldump -u opencats-admin -p opencats > backup.sql
(you'll need to replace user 'opencats_admin' and 'opencats' with whatever you have called the admin user and the opencats database. If you have a large database - then you can also choose to compress the sql file at this time


Then - transfer this over to your new server, and once you've setup a new opencats database, you can import the dump file using this command;
Code: Select all
mysql -u username -p database_name < backup.sql
If you already have resume's / cv's uploaded, you may as well copy over the whole directory under www/htdocs/opencats so that you get them when you've copied it over, too.


So in summary;
1. Copy over the whole opencats directory
2. Create a new opencats user and database in MySQL on the new server. (just follow the original setup instructions)
3. Copy over the opencats mysql database.

Re: Database Transfer

Posted: 19 Jan 2017, 18:07
by vvon66
Thank you Russ! This is probably out of my technical abilities but I'm all for trying something new. I been trying to learn more so as soon as I'm ready, I'll try it or ask for help if I'm not sure I will be successful. Maybe I could try it as a test first to see if I can do it, lol.

You instructions are very informative so I may be able to do it!

Re: Database Transfer

Posted: 19 Jan 2017, 18:11
by cptr13
There's a gui backup restore feature also look in administration. I don't remember what it's called. But it's obvious. Run the backup, watch and make sure it looks like it completes. Sometimes it works for me, sometimes it doesn't (you can tell by the bar going all the way or hanging.

You should be able to download the backup.bak file to your computer.

Then you use that as the restore file on a new installation.

Re: Database Transfer

Posted: 19 Jan 2017, 18:24
by vvon66
cptr13 wrote:There's a gui backup restore feature also look in administration. I don't remember what it's called. But it's obvious. Run the backup, watch and make sure it looks like it completes. Sometimes it works for me, sometimes it doesn't (you can tell by the bar going all the way or hanging.

You should be able to download the backup.bak file to your computer.

Then you use that as the restore file on a new installation.
I will keep that in mind also. Right now I have a local install that I am getting all my data into and learning my way around. A month or so, I'll probably do a transfer to the server. Thank you for the easy suggestion!

Re: Database Transfer

Posted: 01 Feb 2017, 20:16
by Ilovecats
Hi

I've just tried the Site Backup in Admin and it gave me a .bak file. Can i email that to myself every week incase computer crashes or gets a virus.
Would it contain all the data I've worked on (CV's, contacts, candidates, job orders, etc) if i would to extract the .bak file to another opencats database on a diff computer?

Thanks

Re: Database Transfer

Posted: 02 Feb 2017, 01:19
by cptr13
Yes, if the file is small enough to email, that would work fine. The .bak file contains everything, including attached resumes. If your database grows, uploading to google drive, dropbox, etc is a better way to go.

I would strongly urge you to do at least one test restore (fresh install a SECOND opencats version and choose the restore from backup option).

The gui backup has always worked for me, except on certain shared hosts, where it will freeze up. But if you're going to depend on the backup, you need to test it once or twice to make sure it's backing up correctly.