move full database using unload/load from CUBRID Manager
CUBRID Official Forum » CUBRID Apps & Tools » CUBRID Manager » move full database using unload/load from CUBRID Manager
|
author
|
message
|
|
|
Post subject: move full database using unload/load from CUBRID Manager Post date: 2012.09.11 |
|
registered: 09/08/2012 IP: *.96.215.239 views: 3 |
Hi, What I am trying to do is to move the database from the development server to production server using the interface provided by CUBRID Manager. Here are the steps: 1. stop both databases from both development and production servers 2. unload all schema and data from development database, 2 files are created: metropotam_objects and metropotam_schema 3. move files to production server; give permissions
4. load from files (of course, the database is stopped!)
If I erase all the tables and views then the load works. Also, if a create an empty database the load works. But I don't think that this is the right way to do it. What is the right way to move a database from a server to another using unload/load? Is there another approach? Thanks, |
| Quote | |
|
|
# Post subject:Re: move full database using unload/load from CUBRID Manager Post date: 2012.11.09 |
|
registered: 03/29/2010 IP: *.181.249.254 |
Hi Dragos, The error "Class page already exists" means that the table "page" that the code tried to create already existed in the development server where you ran the load command from CUBRID Manager. Currently, unload/load options do not check if the table already exists. The best solution I assume would be to add an option to either overwrite the given table or to skip it when loading the database. I will report this improvement to be made in the future versions of CUBRID. You have 2 solutions you can use currently: 1. When running unloaddb only export the tables that don't exist in the database where you want to run loaddb. 2. You can right click on any table name, then choose the Export option.
From the Export Data screen you can choose all tables you want and export to either SQL, CSV or other formats.
The last step implies importing the data, by right clicking on the Tables line under the database in which you want to import the data and choose the option "Import". Then just select the files and file types.
Best regards, The CUBRID Team |
| Quote | |
|
|
# Post subject:Re: move full database using unload/load from CUBRID Manager Post date: 2012.11.09 |
|
registered: 09/08/2012 IP: *.96.215.239 |
Thank you for the quick answer. But, what does the message "Restart loaddb with '-s /var/cubrid/databases/metropotam/metropotam_schema:1' option" mean? I can't find any reference for the ":1" in documentation - http://www.cubrid.org/manual/841/en/Loading%20Database |
| Quote | |
|
|
# Post subject:Re: move full database using unload/load from CUBRID Manager Post date: 2012.11.09 |
|
registered: 05/31/2011 IP: *.91.139.66 |
Hello Dragos, Please ignore the ":1" part. What it tries to suggest is that you can load the database schema from the command line. So, please try to first load the database schema, like: cubrid loaddb -s /var/cubrid/databases/metropotam/metropotam_schema metropotam Please, make sure the metropotam database has been created on the Production server and it doesn't contain table you try to load. Because it will try to create these tables you've just unloaded from your Dev server. Since the loaddb command is designed to load the database, it doesn't check if any specific table already exists. So, if it can't create a table, it will give an error. Like Ovidiu has said, we will register a feature request for this feature. |
| Quote | |
|
|
# Post subject:Re: move full database using unload/load from CUBRID Manager Post date: 2012.11.09 |
|
registered: 09/08/2012 IP: *.96.215.239 |
Hi Esen, I managed to import everything on an empty database (I had to remove all the tables and views). Could you please tell me what is the best approach from moving a database from one place to another? Thanks, |
| Quote | |
|
|
# Post subject:Re: move full database using unload/load from CUBRID Manager Post date: 2012.11.09 |
|
registered: 03/29/2010 IP: *.91.139.66 |
The best approach is, of course, unloaddb, then loaddb. It's the fastest and backward compatible way of data migration from one server to another, or from one version of CUBRID, to another. Each of these utilities have various powerful options. Let me know if you have any difficulties using unloaddb/loaddb utilities. |
| Quote | |
