5 Import
The contents of a Smallsite Design site can be archived, and from an archive, overwrite all the current content or import some elements.
Overwriting a site from an archive can lead to loss of some content.
Make sure you understand the consequences of such actions, perhaps getting help to discuss what changes need to be made to make the process easier. An as-is archive is always created when instigating an
For simple elements, like paragraphs with plain text, recreating them and copying their text to them may be conceptually simpler to achieve, whereas more complex elements, like subsites and tables, will be much more straightforward to just import. Horses for courses.
Archives△
Archives of the site are created periodically and during some operations, but are automatically deleted according to a calendar-based schedule.
Archives are a complete .zip file of all the content (not program) files in a site. They can be downloaded, uploaded, used to completely replace the content of a site (overwrite) or selectively import elements from.
There is no difference between automatic and manual archives internally, but it is for reference when determining if an archive was generated during an operation on the Import page (manual) or routine logins (automatic).
Each time period excludes that time already covered by later time periods, so
# | Part | Description |
---|---|---|
a | dt | Date and time saved as yyyy-mm-dd-hh-mm-ss using UTC as a time reference |
b | sid | |
c | t | Type of archive, where a is automatic and m is manual |
d | algo | Algorithm used to generate the hash |
e | hash | Hash of the file contents in hex characters. The length is dependent upon the |
f | zip | Extension for archive files |
Manual archive must be explicitly managed and deleted if not needed. Archives do not include anything that is regenerated automatically or of non-critical use, such as search or statistics files.
Archive list△
The archive list shows the available archives and the operations that can be done on each.
# | Name | Description |
---|---|---|
1 | ID | Archive identifier as its date-time of creation. Currently for the site itself |
2 | Site | Site identifier as specified in the |
3 | Mode | Loaded for the current site Automatic if created at master manager login Manual if actioned on this page |
4 | Files | List of the numbers of all elements in the site or an archive, including any changes required to locales for import. Use to identify possible import issues |
5 | Actions | Actions available for the current site or an archive, followed by any errors that prevent importing |
# | Action | Description |
---|---|---|
a | Archive | Create an archive of the current site |
b | Upload | Upload an archive file to the site |
c | Delete | Delete the archive |
d | Overwrite | Import the whole archive to replace the current site |
e | Import | Import part of the archive. Followed by a 👇 if an element has been selected. Followed by a ✔ if it has an imported list. Only shown if no errors that would prevent importation are found |
f | Download | Download the archive from the site |
When overwriting a site, the current master manager's details are added so that they can log in immediately after. Any similar user from the source archive will have a _ added after their user ID.
Importing△
While overwriting a site from an archive is straightforward, importing elements is dependent upon locales and ID conflicts.
The master locale of a site can only have its region changed, so unless the master locale in the archive to be imported from has the same master locale or only differs in region, it cannot be imported. If still eligible, for any other locale in the archive that cannot be renamed to match one in the site, any elements with text for that locale will have that text removed before importing. Alternately, add the locale to the current site, so that text will not be rejected. When expanded, the
# | Archive | Site | Result | Import |
---|---|---|---|---|
a | en-001* ar-001 ✘ | en-001* de-de | Masters match. ar-001 stripped. No de-de in imports | Yes |
b | en-us* en-ca | en-001* en-gg | Master renamed to en-001. en-ca renamed to en-gg. No en conflicts as the masters evaluated first, then excluded from following comparisons | Yes |
c | en-ca* en-001 ✘ | en-001* | en-ca renamed to en-001. en-001 stripped because masters already handled, so nothing to rename to | Yes |
d | en-001* en-ca ✘ en-us | en-001* en-us | Masters match. en-us match. en-ca stripped. No conflict as exact matches evaluated next after masters, then excluded from following comparisons | Yes |
e | en-001* en-us ? en-ca ? | en-001* en-au ? | Masters match. Conflict because two source locales could be renamed to match the non-master site locale | No |
f | en-001* en-us ? | en-001* en-ca ? en-au ? | Masters match. Conflict because the non-master source locale could be renamed to either of the site ones | No |
The last two situations can be made alright for importing by making a source locale match a destination locale, but that would have to be done on the live site from which the archive was obtained. However, that locale on the source site could be renamed back to its original after getting the archive, so that the site is restored.
In today's internet, people have been getting used to sites using the same language having different spellings and expressions, especially given the dominance of US English content over the early times of the internet. Typically now people will write how they are used to, and let readers accept the spelling and other differences.
Having two or more locales with the same language (and script) but different regions is usually to cater for audiences who really want to retain the different idioms and expressions they are used to, and that is why renaming regions is not really a solution. Yes, it may get around the technical issues of importing, but anything imported with renamed regions would have to be carefully checked that all content is consistent with the new locales.
Some elements in the archive might have IDs or internal references that are the same as elements in the site. The
Any elements that cannot be imported will need to be recreated in the site and the text individually copied from the source elements. For simple elements, this may be the most efficient way compared to importing, Some content of elements may be removed if it is not critical or possibly irrelevant to the current site, such as spike contents in user files.
Workflow△
Not all elements undergo the same processing.
Only one element is selected for import, and any descendant elements will be imported along with it unless excluded. Elements like files or users are self-contained, so they will be imported by themselves. Most of the other elements can use files, so any that are duplicates of those already in the current site can be excluded, though there are advantages to temporarily keeping them. Similar with elements owned by subsites or categories which might also be excluded. After any exclusions, categories and articles must have their new owner in the current site selected.
Element Subsite 👇👇I3✔Category 👇👇I👇✔Article 👇👇I👇✔File 👇VI3✔User 👇VI3✔Phase Select the
import
elementSelected
elementImportSelect the
ownerDone👇I3IVLegend:SelectImport ☐ImportView only
Select the import element△
An element in the archive has to be selected.
Drill down to select the one element to be imported. 𝝙 indicates an element that will be renamed to prevent duplicates. Subsites and categories can use files, indicated by a + after the number of categories or articles respectively.
Selected element△
Some elements allow their descendants to be excluded from the import.
Click on each element to exclude. Click again to re-include. Files listed under subsites, categories or articles are a link to their entry under
Categories and articles are only ever owned by one element, but files may be pointed to by several, which means that care must be taken to not exclude files that might be used by multiple imported elements, even if they result in duplicates. The duplicates can always be deleted after all the new elements that point to them are repointed to the existing file versions. Doing it this way, rather than risking dead pointers by aggressive exclusioning will allow the site to maintain its operational and visual integrity without having to rush to fix up anomalies.
After the highlighted ID of the selected category or article, clicking the
After the highlighted ID of the selected subsite, file or user, clicking the
Clicking the
Select the owner△
For a selected article or category, the new owner element must be selected.
For a selected article or category, there is no way to automatically know where they will need to be imported to, so its new owner in the current site must be clicked on. Drill down to find it. After selection, another element can be selected from the archive for import.
Import elements list△
All the elements to be imported are listed, including any changes to prevent duplicate identifiers.
After selection or modification, the list always includes all elements to be included in the import, along with any changes to identifiers that will be made.
# | Name | Description |
---|---|---|
1 | Type | The type of element being imported, including purpose for files |
2 | ID | Element identifier, if applicable. If to be renamed, the new ID is underneath |
3 | Created | Unique internal element identifier as its creation date. If to be changed, the new identifier is underneath, usually differing by one second from its source |
4 | Comments | Text for files, else blank |
Imported elements list△
All the elements that were imported are listed as jumps to their respective pages.
# | Name | Description |
---|---|---|
1 | Type | The type of element imported, including purpose for files |
2 | ID | Element identifier as a jump to its page. If deleted, shown |
3 | Imported as | If changed, element's identifier when imported |
The list will be available until the archive is deleted or another element to import has been selected. It provides the status of all elements imported, even if renamed or deleted, so it can be used to keep track of what has happed to the elements since importation. A list is retained for each archive used to import from, so if wanting to import more elements, while still wanting to keep track of the previously imported elements, use another archive.
Cleanup△
The relationships between the elements of site can be complex, so importing other elements into a site may create conflicts if not prevented.
Imported elements might have the same names as existing elements, and they will be suffixed with numerals. These will be documented in the list of elements to be imported, and will need to be renamed to something ending less cryptically. The selected element will be hidden or disabled when imported. Descendant categories or articles of them will have their original show status, but will be effectively hidden by the selected element's status. Dependent files will be enabled.
The relationships between elements are maintained by unique date-based identifiers which are normally invisible, but may need to be automatically changed to prevent inadvertent conflicts when elements are imported. These are itemised in the Import elements list. Subsites, files and users are automatically added to the existing site's host elements, while categories and articles will need to be pointed to their new owning element, even though internally they are added to their type's host element, otherwise they would be hidden from discovery.
Descendent elements of the element to import will still point to it, even if their internal identifiers have to be changed to prevent duplicates. If some of those descendants were excluded because there were already versions of them in the existing site, some links in the elements that were imported may have to be manually re-pointed to those existing elements. Files are pointed down to in a
While every imported element will have a home in the existing site that allows them to be drilled down to, specifying exclusions will usually require a review of the resulting structure to make sure there are no gaps or dead links. Importing missing elements later will not restore any relationships they had to other elements in the archive they were imported from, so those relationships will have to be recreated. It is better to import potential duplicates so that relationships are maintained than try remembering what they were, and then repoint them and delete any orphan elements afterwards.