Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. First, you should STOP tomcat on the old server.  These steps require the site to be down.
  2. Update sequences (optional) - When migrating content, sometimes sites will find that database sequences will be outdated or incorrect.  This can result in "duplicate key" errors during the database migration to the latest version.  To avoid this, before  you export your data, run this older copy of the "update-sequences" command on your database.  This should ensure your database sequences are updated before you dump your data.  

    Code Block
    # If upgrading from DSpace 6 or below, run this on your old database
    psql -U [database-user] -f [dspace]/etc/postgres/update-sequences.sql [database-name]
    # e.g. psql -U dspace -f [dspace]/etc/postgres/update-sequences.sql dspace
    1. NOTE: It is important to run the "update-sequences" script which came with the OLDER version of DSpace (the version you are migrating from)!  If you've misplaced this older version of the script, you can download it from our codebase & run it via the "psql" command above.
      1. DSpace 6.x version of "update-sequences.sql": https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace/etc/postgres/update-sequences.sql
      2. DSpace 5.x version of "update-sequences.sql": https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace/etc/postgres/update-sequences.sql
  3. The database data - Make sure to export the database data from your old DSpace site using a tool like "pg_dump" (for PostgresSQL).  If you use "pg_dump", you'll end up with a large SQL file which contains all the data from your old database. 

    Code Block
    # Example of using pg_dump to export a database to an output file
    pg_dump -U [db_username] [db_name] > [output_file.sql]


  4. The "assetstore" folder - This folder is in your DSpace installation directory and it contains all the files stored in your DSpace.  You will need all the contents of this folder (including all subdirectories), so you could choose to zip it up or you could copy it over directly.
  5. The Solr data (optional) - Both DSpace authority and statistics are stored in Solr. If you want to keep these, you will want to export them from the old Solr and move them over.  Use the "solr-export-statistics" tool provided with DSpace:  see "Export SOLR Statistics" in the Solr Statistics Maintenance guide.   (Requires Solr to be running. Keep in mind, this may require you to start Tomcat back up if Solr is running in Tomcat.)

...

Perform these steps on the new server. 

Optionally, you may wish to run the "update-sequences" command to ensure all the database sequences (used to insert new data in your database) are up to date.  Sometimes, these sequences can get outdated or reset during the process of moving databases around.  This command will do nothing if your sequences are already up-to-date.  But, if they are somehow outdated, then it will ensure the "migrate" command doesn't throw errors related to outdated sequences. More information on this command can be found in Database Utilities.

...

  1. Migrate/Upgrade the database to the latest version - Now that your old data is migrated, you MUST ensure it's using the latest database updates based on the new DSpace you've installed.  Review the database steps in Upgrading DSpace and follow the instructions there.  

    Code Block
    # Migrate your old data to the latest DSpace version
    # WARNING: You must review the Upgrading DSpace docs to see if there are any additional database steps listed there!
    ./dspace database migrate ignored


    NOTE: You should check the logs (dspace.log) for errors.  Additional steps may be documented in the Upgrading DSpace guide.
  2. Start Tomcat.  This will bring your new DSpace back up, with the migrated data in place.  Check the backend logs (dspace.log and Tomcat log) to ensure no errors occur on startup.
  3. Reindex all content - This will ensure all search/browse functionality works in the DSpace site.  Optionally, if you use OAI-PMH, you will want to reindex content into there as well.

    Code Block
    # Reindex all your content in DSpace
    ./dspace index-discovery -b
    
    # (Optionally) also reindex everything into OAI-PMH endpoint
    ./dspace oai import

    NOTE: Until this command completes (it may take a while for large sites), you will not be able to fully browse/search the content from the User Interface.  To check the progress of the reindex, check your dspace.log file.

...