Sync


Photon Sync is a process that synchronizes two Photon CMS installations. It solves numerous pain-points that most modern CMS systems experience. Here are some examples:

Push-to-deploy project structure updates
enabling programmers to simply push the latest code version and the database structure on the remote server will be automatically updated while preserving the user-generated data

Start entering website data early in the process of programming
Client projects deadlines are always short, and clients are eager to start entering data as soon as possible. Frequent database structure changes made this process very difficult - if not impossible, but Photon Sync performs this task automatically without any need for intervention on your part, whatsoever.

Team Project Sync
enabling team members to quickly sync their local dev installations using file versioning system. No longer you need to share database dump files with your teammates. Sync your projects using file versioning system alone.

Table of Contents
  1. Video Walkthrough
  2. Sync Process Overview
  3. Use Cases

Video Walkthrough

Sync Process Overview

To sync Photon CMS installation A with installation B, the following actions are required:

1. Git commit all changes from project A to the repository
2. Pull the changes into project B
3. Run php artisan photon:sync console command from project B web root

The sync modifies project B’s structure to match the project A’s structure, and the user-generated data originally entered in project B is preserved. Note that sync process does not migrate user-generated data (e.g. users, assets, menus and other various module entries).

Simplified, the sync process does the following:

1. Backs-up all user-generated data stored in database tables
2. Removes all models and database tables
3. Regenerates models and database tables based on the imported data
4. Re-populates the user-generated data

Use Cases

Quick-deploy to Staging Server Using Laravel Forge

Photon Sync feature enables your clients to start entering the content using Photon CMS Control Panel long before your project is completed. As you deploy the new code versions, old data is automatically preserved and re-populated once the project structure is updated via sync.

Pre-requisites:
- Git repository
- Laravel Forge service subscription
- Photon CMS License

Setup:
1. Download and install Photon CMS in your local dev environment
2. Publish the source code to a git repository
3. Setup a staging domain using Laravel Forge
4. Connect the domain to the git repository
5. Add the php artisan photon:sync to the end of your Deploy script
6. Enable quick deploy

As soon as you push your code to the git repository staging server will automatically update the project structure while preserving user-generated data that was entered through your staging website. 

We recommend that you also automate the backup of your web-root folder and your database. Changing of database structure can have unforeseen effects on entered data!

Deploy new code version to live server using Laravel Forge

Photon Sync feature enables you to deploy new code version while automatically preserving the old data.

Pre-requisites:
- Git repository
- Laravel Forge service subscription
- Photon CMS License

Setup:
1. Download and install Photon CMS in your local dev environment
2. Publish the source code to a git repository
3. Setup a live domain using Laravel Forge
4. Connect the domain to the git repository
5. Add the php artisan down to the start of your Deploy script - enabling the maintenance mode will prevent any new data from being entered during the sync process
6. Add the php artisan photon:sync to the end of your Deploy script
7. Add the php artisan up below the photon:sync command to exit the maintenance mode

When you push your code to the git repository and hit the deploy button in forge, the server will automatically update the project structure, while preserving user-generated data that was already entered. 

We recommend that you also automate the backup of your web-root folder and your database. Changing of database structure can have unforeseen effects on entered data.

Deploy new code version to live server with zero-downtime

Photon Sync feature enables you to deploy new code version while automatically preserving the old data.

Pre-requisites:
- Git repository
- Laravel Forge service subscription
- Lravel Envoyer service subscription
- Photon CMS License

Sign-up to stay informed about news and updates.