Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

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
[Level:0]dragosh_r0ck

Post subject: move full database using unload/load from CUBRID Manager

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

load.jpg

4. load from files (of course, the database is stopped!)

load2.jpg


5. i got the following error message

load3.jpg 


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,
Dragos


Attachment:

Quote
[Level:8]CUBRID

# Post subject:Re: move full database using unload/load from CUBRID Manager

profile

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.

export.png

From the Export Data screen you can choose all tables you want and export to either SQL, CSV or other formats.

export_data.png

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.

import.png

Best regards,

The CUBRID Team

Quote

Attachment:

[Level:0]dragosh_r0ck

# Post subject:Re: move full database using unload/load from CUBRID Manager

profile

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
[Level:2]Esen Sagynov

# Post subject:Re: move full database using unload/load from CUBRID Manager

profile

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
[Level:0]dragosh_r0ck

# Post subject:Re: move full database using unload/load from CUBRID Manager

profile

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,
Dragos


Quote
[Level:8]CUBRID

# Post subject:Re: move full database using unload/load from CUBRID Manager

profile

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




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: