In this article I want to show you a way how to access two projects (on the same RedDot CMS server) at the same time. This is very useful to copy data from one project directly to an other. I used it one year ago for a relaunch of the Hapag-Lloyd’s site www.hapag-lloyd.com.
Here I want to show you the way to reuse the login information while you are connected with one user per project. But it is also possible to login via user name and password.
CmsClient clientOld = new CmsClient(logonGuidOld);
Project projectOld = clientOld.getProject(sessionKeyOld, projectGuidOld);
CmsClient client = new CmsClient(logonGuid);
Project project = client.getProject(sessionKey, projectGuid);
Page sourcePg = projectOld.getPageById(“old page id”);
Page targetPg = project.getPageById(“new page id”);
As you can see it’s quite simple to program an access to several projects at the same time. Using the available methods for getting and setting data you can satisfy almost every migration task you receive (as long as jRQL offers it).
I used exactly this approach to directly create all of our office pages in the new project and fill all contact data from old into the new table. It takes one morning to write the program and streamline the old data before writing it again. Within some hours the program does the job. This is one of my personal success stories.
You can even migrate images and media files following these steps:
- programatically download the files from the old project under a new filename (if you need)
- manually copying all files to the server machine and import it into the new project’s folder
- use another jRQL program to set all new filenames in the new project’s pages
For further details on downloading images, please refer to the article about image editing.
On such a migration task you usually need to access a big amount of pages, therfore you should have a look how jRQL helps you to handle a list of pages.