Skip to content

I want to duplicate multiple linked sites while maintaining the link relationships

Answer

Please use "Export Site Package" and "Import Site Package".


Overview

After placing multiple linked sites in the same folder, you can duplicate them while maintaining the link relationship by "Export Site Package" from the folder hierarchy and then "Import Site Package" as is. Also, if you export and import including data, the data will be duplicated while maintaining the link relationship.

Diagram of linked sites being duplicated with their link relationship kept

Furthermore, by writing site IDs in the specified format, "Script" and "Server Script" can also be duplicated while maintaining the link relationship.

Limitations

  1. ID replacement in the processing of "Script" and "Server Script" is available in version 1.4.9.0 and later.

Format for Replacing IDs in the Processing of Scripts and Server Scripts

1.4.9.0

In the processing of Script and Server Script, numeric strings within the range enclosed by // @siteid list start@ and // @siteid list end@ are replaced with the site IDs after the import. Always write // @siteid list start@ at the beginning of a line.

// @siteid list start@
const siteId = 1000;
const tableIds = [1001,1002,1003,1004];
// @siteid list end@

/* Omitted below */ 

Example of ID Replacement

This is an example in which site IDs are numbered from 2000 after the site package is imported.

Before Replacement (the State Inside the Site Package)

// @siteid list start@
const sitePC = 1000;
const masterOS = [1001,1002,1003,1004];
// @siteid list end@
const wiki = 1005;

// The values of the consts are used in the processing that follows.
if (sitePc == $p.id())  { /* Some processing */ }

After Replacement (the State Inside Pleasanter After the Import)

The numbers enclosed by // @siteid list start@ and // @siteid list end@ are replaced with the site IDs after the import. Numbers outside the range (wiki = 1005) are not replaced.

// @siteid list start@
const sitePC = 2000;
const masterOS = [2001,2002,2003,2004];
// @siteid list end@
const wiki = 1005;

// The values of the consts are used in the processing that follows.
if (sitePc == $p.id())  { /* Some processing */ }