src/source/zodb.rst
changeset 21 e1cb9c606859
parent 10 1d12ff3f036a
child 34 f234f01d54f9
equal deleted inserted replaced
20:8c0c5400e770 21:e1cb9c606859
   146 Newt adds a search API for searching the Postgres JSON data and returning persistent objects. It also provides a
   146 Newt adds a search API for searching the Postgres JSON data and returning persistent objects. It also provides a
   147 convenient API for raw data searches.
   147 convenient API for raw data searches.
   148 
   148 
   149 Database creation is done as with RelStorage, but NewtDB add several schema objects. Migration scripts are available
   149 Database creation is done as with RelStorage, but NewtDB add several schema objects. Migration scripts are available
   150 if you need to switch from a classic RelStorage database to a Newt database.
   150 if you need to switch from a classic RelStorage database to a Newt database.
       
   151 
       
   152 
       
   153 .. _ZODB.init:
       
   154 
       
   155 Initializing ZODB
       
   156 +++++++++++++++++
       
   157 
       
   158 When your ZODB is created, you have to initialize it!
       
   159 
       
   160 After installing PyAMS application (see :ref:`appinstall`), a database upgrade script is available which allows you
       
   161 to initialize the database. See :ref:`config` and :ref:`scripts` to know more.
       
   162 
       
   163 
       
   164 .. _ZODB.migration:
       
   165 
       
   166 ZODB migration
       
   167 ++++++++++++++
       
   168 
       
   169 After installation, you can switch from a given storage to another one with the help of the *zodbconvert* command
       
   170 line script provided by RelStorage.
       
   171 
       
   172 This Python script is using a configuration file containing directives of both source and target databases, which can
       
   173 be any storage described in the previous sections (or can even use the same storage).
       
   174 
       
   175 Here is a sample configuration file to convert a ZODB from a ZEO to RelStorage:
       
   176 
       
   177 .. code-block::
       
   178 
       
   179     %import relstorage
       
   180 
       
   181     <zeoclient source>
       
   182         server zeo-server.mydomain:8100
       
   183         storage pyams
       
   184         blob-dir /var/local/env/zeo/var/zeoclient/blobs
       
   185         shared-blob-dir false
       
   186     </zeoclient>
       
   187 
       
   188     <relstorage destination>
       
   189         keep-history false
       
   190         blob-dir /var/local/env/pyams/var/relstorage/blobs
       
   191         shared-blob-dir false
       
   192         <postgresql>
       
   193             dsn host='postgresql-server.mydomain' dbname='pyams_rs' user='pyams' password='xxxxxxxx'
       
   194         </postgresql>
       
   195     </relstorage>