跳至內容
選單
此問題已被標幟
3 回覆
6938 瀏覽次數

Hi,

We have an OpenERP setup that has 2 databases : One production and one test. The problem is that the test database is quite old and not accurate, so our tests cannot be reliable. My question is surely quite simple, but i'm inexperienced enough to be unsure about it...

On the login script, a user can access the "manage database" menu which let the user the ability of creating, backuping, restoring DBs. We're dumping our production database every 24H. Is it possible to restore the production dump into the test database with a simple action ? I'm afraid of the dump to have the "production" name in it and therefore induce some restore problem (but i may be wrong)...

What is the simplest and most reliable method to copy our production database into the existing test database ?

Thnaks in advance for your answers.

regards

頭像
捨棄
作者 最佳答案

yes Clement, only one server and 2 DBs. So far, we're not running virtual server, but maybe in the future.

頭像
捨棄
最佳答案

I think sparenton want to have one server with 2 db. I have no experience with "manage database" menu, but, you can use pgAdmin to manage your databases.

In pgAdmin :

  1. Connect your server
  2. Right click on a database, and backup it (I use custom format).
  3. Create new database (with the same owner than production database)
  4. Restore your backup.

You can use "cron" in a linux server to do a backup periodically.

An other way to duplicate database (but you must stop openerp server) :

  1. Close all connections to your production database
  2. Connect to postgres database
  3. Launch SQL command : "create database my_duplication_of_prod_db with template prod_db"

I don't know what's your infrastructure but another (more secure) alternative to backup your openerp server if you work with virtualization is to backup entirety of VM (that's the best I think but not everyone works with virtualization).

頭像
捨棄
最佳答案

Copy your OpenERP source code along with the libraries and configuration to another server. After that restore the database backup you created with pg_dump

頭像
捨棄