Propagate Changes from Test to Production with Oracle Content Management Toolkit
After you develop a site template, you can use the command-line interface (CLI) of Content Toolkit to propagate the template from development to test to production on your Oracle Content Management servers.
To propagate changes, you can use Toolkit commands to create sites and manage their life cycles on development, test, and production servers. You can make changes to sites in a development environment and propagate those changes to test and production environments. You can also incorporate this set of command-line utilities into your scripting environments to manage your deployments. With the CLI utilities, you can roll out new items, such as assets and components, as well as updates of existing content.
The following steps show how to use the Content Toolkit CLI to propagate your changes from development to test to production:
-
Set up development, test, and production servers with the same repository and localization policy.
To propagate changes from a development server to a test server and then to a production server, you need to set up a repository with the same name and localization policy on each of the three servers. The default localization policy for the asset repository is en-US, but you can use a different one if it is the same in all three servers.
-
Register your development, test, and production servers with Oracle Content Management.
Before you propagate changes to a site, you need to register each of the servers. You can register a server with the
cec register-server
command provided by Content Toolkit:cec register-server <name>
Specify the following command options:
-
-e <endpoint> for the server URL
-
-u <user> and -p <password> for connecting to the server
-
-t <type>, which is optional, to set the server type. The default value is
pod_ec
.When connecting to an Oracle Content Management tenant on Oracle Public Cloud, use
pod_ec
only.
For example, the following command registers a server that is a tenant on Oracle Public cloud:
cec register-server DEV -e https://DEV.example.com -u user1 -p <password>
The next command registers a standalone development instance of Oracle Content Management:
cec register-server DEV -e https://DEV.git.oraclecorp.example.com -u user1 -p <password>
After you register an Oracle Content Management server, you can list its contents with the
cec list
Toolkit command.The following command lists the contents of a development server:
cec-compontents> cec list -s DEV - Logged in to remote server: <host:port> Channels: Name Token StarterSite <site-id> Components: Name Type Published FooterBar Component group StarterComponent Local component StarterFooter Component group StarterNavMenu Local component Localization policies: Name Required languages Optional Languages en-US en-US Repositories: Name r Sites: Theme Type Published Online Name StarterSiteTheme Enterprise Templates: Name Theme Type StarterTemplate StarterTheme Standard
-
-
Upload a site template to your development server and create a site from the template.
You can create a site template with the
cec create-template
command and then upload the template to the development server. Then you can create a site from the template with thecec create-site
command. The following commands create a template and upload the template:- cec create-template blog -f BlogTemplate - cec upload-template blog -s DEV
The next command creates a site named
blog
from the uploaded template:cec-components> cec create-site blog -t blog -r r -l "en-US" -d "en-US" --server DEV - Logged in to remote server: <https:<host:<port> - establish user session - get template - get repository - get localization policy - creating enterprise site . . . name blog template blog site prefix blog repository r localization policy en-US default language en-US - submit create site site - create site in process: percentage 95 - create site in process: percentage 95 - create site in process: percentage 95 - create site in process: percentage 95 - create site in process: percentage 95 - site created
-
Publish the site and bring it online on your development server.
After you create a site, you can use the
cec control-site
command to publish the site and bring it online:cec-components> cec control-site Usage: cec contrl-site <action> Perform <action> on site in CEC server. Specify the site with -s <site> Specify the server with -r <server>. publish unpublish bring-online take-offline Options: --site, -s <site> Site --server, -r <server> The registered CEC server --help, -h Show help Examples: cec control-site publish -s Site1 Publish site Site1 on the server cec control-site publish -s Site1 -r UAT Publish site Site1 on the registered server UAT cec control-site unpublish -s Site1 -r UAT Inpublish site Site1 on the registered server UAT cec control-site bring-online -s Site1 -r UAT Bring site Site1 online on the registered server UAT cec control-site take-offline -s Site1 -r UAT Take site Site1 offline on the registered server UAT Not enough non-option arguments: got 0, need at least 1 cec-components> cec control-site publish --site blog --server DEV - Logged in to the remote server: https://<host>:<port> - establish user session - get site: runtimeStatus: offline publishStatus: unpublished - submit publish site - publish in process: percentage 20 - publish in process: percentage 40 - publish in process: percentage 49 - publish in process: percentage 49 - publish in process: percentage 50 - publish in process: percentage 50
-
To move a site from DEV to UAT, you need to package up the site. The packaging model for moving sites between servers is the template. Create a new template from the site you created on your development server and download the template.
The
cec create-template-from-site
command in the following example creates a site template namedblog2
fromblog
.cec create-template-from-site blog2 -s blog
Download the template you created from your development site with the
cec download-template
command:cec-components: cec download-template blog2 --server DEV - Logged in to remote server: https://<host>:<port> - establish user session - export template - template download to /Users/<user-name>/devenv/git/webclient/developer/sites-toolkit/cec-components/dist/blog2.zip - the template will be at /Users/<user-name>/devenv/git/webclient/developer/sites-toolkit/cec-components/src/main/templates/blog2 - the theme for the template will be at /Users/<user-name>/devenv/git/webclient/developer/sites-toolkit/cec-components/src/main/themes/blogTheme - create link _scs_theme_root_ - create link _scs_design_name_ - override component /Users/<user-name>devenv/git/webclient/developer/sites-toolkit/cec-components/src/main/components/Starter-Blog-Author-Summary - override component /Users/<user-name>devenv/git/webclient/developer/sites-toolkit/cec-components/src/main/components/Starter-Blog-Post-Content - override component /Users/<user-name>devenv/git/webclient/developer/sites-toolkit/cec-components/src/main/components/Starter-Blog-Post-Header - override component /Users/<user-name>devenv/git/webclient/developer/sites-toolkit/cec-components/src/main/components/Starter-Blog-Post-Search-Result - override component /Users/<user-name>devenv/git/webclient/developer/sites-toolkit/cec-components/src/main/components/Starter-Blog-Post-Post-Sidebar - override component /Users/<user-name>devenv/git/webclient/developer/sites-toolkit/cec-components/src/main/components/Starter-Blog-Post-Summary - set themeName to blogTheme in siteinfo.json - unzip tmplate content file *** template is ready to test: https://localhost:8085/templates/blog2 cec upload-template blog2 --server UAT
-
Upload the template to create the content types and content layout maps.
cec upload-template blog2 --server UAT
-
Upload the template but exclude the content items (content template) from the template.
cec upload-template blog2 --server UAT -x
You want to do this to create a site with content that has the same GUIDs as the original site. When you create a site from a template that contains content, all the content in the new site will have new GUIDs. Because we want to allow update of content rather than creating new content, you need to exclude the content from the template.
-
Create the site from the template.
cec create-site blog -t blog2 -r r -l "en-US" -d "end-US" --server UAT
-
Upload the content template to the site's channel and collection. You need to do this because you excluded it from the template in step 7.
cec upload-content blog2 -t -r r -c blog -l "blog site" --server UAT
-
Publish the site and bring it online on your test server.
Use the
cec control-site
command to publish the site and bring it online:cec-components> cec control-site publish --site blog --server UAT - Logged in to the remote server: https://<host>:<port> - establish user session - get site: runtimeStatus: offline publishStatus: unpublished - submit publish site - publish in process: percentage 20 - publish in process: percentage 40 - publish in process: percentage 49 - publish in process: percentage 49 - publish in process: percentage 50 - publish in process: percentage 50 - publish blob finished
-
If you then make changes to your site
blog
on the DEV server, you can propagate the changes to the site you have already created on the UAT server. -
Create another template from your site so the template will have your changes.
cec create-template-from-site blog3 -s blog --server DEV
-
Download the template.
cec download-template blog3 -s DEV
-
Upload the template and create a site from it to propagate the changes to your test environment.
cec upload-template blog3 -s UAT
This command creates or updates any components and themes that have changed, but excludes the content.
-
Now use the
update-site
command to pick up the content and update the pages.cec update-site blog -t blog3 - UAT
For example:
cec-components> cec update-site blog -t blog3 --server UAT Updating site: blog3 - Logged in to remote server: https://<host>:<port> - pages : updating file# 6 of 6 files - content : updating file# 3 of 3 files - System Files : updating file# 5 of 5 files - controller : no files in update, removing files on server - favicons : no files in update, removing files on server - misc : no files in update, removing files on server - seo : no files in update, removing files on server - system : no files in update, removing files on server - created content file /Users/<user-name>/devenv/git/webclient/developer/sites-toolkit/cec-compnents/dist/blog3_export.zip - upload content file - get CSRF token - submit import job, updating content - import job in progress. . . - import job in progress. . . - import job in progress. . . - content imported: Update Site Results: - Site Pages : completed with 0 errors. - Embedded Content : completed with 0 errors. - System Files : completed with 0 errors. - Settings Files : completed with 0 errors. - Content Update : completed with 0 errors.
-
Check the site to verify that the changes were propagated.
-
Do the same steps to move from the UAT server to the PROD server as you did to move the site from DEV to UAT.
-
Create the site on your production server, bring it online, and verify the changes.
You can use the
cec list
command to view the contents of your production site and make sure it includes the changes you made in the development environment. Also, you can check the site to verify that the changes have been propagated to production.