Migrating from Alfresco 5.x to 6.x? Quickly backup and restore your data in 4 EASY STEPS
Tags: alfresco, databackup, datamigration
Published: 2023-01-27 05:13:08

Alfresco Content Services (ACS) 6.x is the Enterprise Content Management (ECM) system your organization should be eyeing right now if it prioritizes its content and wants to switch to a highly scalable, performance-driven, and compliance-friendly model that provides 24×7 enterprise-grade support for all business-critical content. ACS 6.x is basically built around a repository with a support server that aggregates all kinds of metadata, text indices, associations, and other related content.

A number of organizations who were stuck with Alfresco 5.x until now are migrating to Alfresco 6.x due to the enhanced feature set. However, backing up entire databases and restoring them safely during migration is no easy task, especially when NAS storage is involved.

Fear not fellow Alfresco-naut, for in this blog, we bring you 4 easy steps that will make the backup and restoration activity a walk in the park!

Note: The names and naming conventions used here are for demonstration purposes only, please change them as necessary.

**Step 1**: Take the backup of PostgreSQL and alf_data from Alfresco 5.x

- Stop the Alfresco 5.x and Alfresco 6.x Services

- Go to the PostgreSQL installation path inside the bin and run the following command for taking the PostgreSQL database backup
    **pg_dump -U postgres -p 5433 -d alfresco>
    /tmp/backupDMS/alfresco_backup_new.sql**

- Take the backup of the alf_data folder from Alfresco 5.x
- Place the alf_data backup folder into the NAS box
- Copy the folders inside the contentstore from the backup folder to volume1/DMS1/contentstore.

- Copy the folders inside contentstore.deleted from the backup folder to volume1/DMS1/contentstore.deleted

- You need to similarly copy year wise folders of contentstore and contentstore.deleted

- Finally go to the Alfresco 6.x inside alf_data folder and provide permissions of **alfresco:Alfresco** to all year wise folders inside **contentstore** and **contentstore.deleted** folders

Step 2: Restore the PostgreSQL database of Alfresco 6.x

- Go to the PostgreSQL installation path
- Connect to the database
- Create the new database and provide permissions using the following commands
- create database alfresco;
- grant all privileges on database alfresco to alfresco;
- grant all on database alfresco to alfresco;
- grant all on schema public to alfresco;
- grant all privileges on database alfresco to postgres;

- Go to the PostgreSQL installation path (inside bin folder) of Alfresco 6.x and run the command below for restoring the database.
     psql -U postgres -p 5432 -d alfresco -h 127.0.0.1 <
    /tmp/backupDMS/alfresco_backup_211022.sql

- Wait for the data to be restored fully

**Step 3**: After the restoration is completed, go to the alfresco-global.properties file from Alfresco 6 and check the database properties like the following:
       ** ### database connection properties ###
        db.driver=org.postgresql.Driver
        db.username=alfresco
        db.password=alfresco
        db.name=alfresco
        db.url=jdbc:postgresql://172.19.98.201:5432/${db.name}**

**Step 4**: Start the Alfresco 6.x services and check the migrated data

Your data should be restored safe and sound in your newly deployed Alfresco 6.x environment!

This article was originally published on [our company blog](https://www.taashee.com/migrating-from-alfresco-5-x-to-6-x-quickly-backup-and-restore-your-data-in-4-easy-steps/).