Site templates
Offer shared site templates to your customers and copy a website from one hosting account into another.
Administrators and resellers can save a customer's website as a shared template that customers start new websites from, and copy a website from one hosting account into another. Customers find shared templates under Site templates in their Control Panel.
Where: Server Admin › Hosting › Site templates (Reseller Panel › Site templates for resellers)
Who sees a shared template
| Saved by | Offered to |
|---|---|
| an administrator | every customer |
| a reseller | that reseller's own customers |
A reseller sees and deletes only their own shared templates; an administrator sees and can delete all of them.
Save a shared template
- Under Save a website as a shared template, enter the Website — a website of an account you manage.
- Enter a Template name, and tick Include uploaded files (images, media) if wanted.
- Click Save template.
Shared templates are kept in /var/lib/hostfog/templates on the main server, readable by the panel only (the folder
is root's, mode 0700). The files are read as the customer's account; the database password is never stored. Accounts on
other servers of a cluster can't use shared templates.
Copy a website to another account
- Under Copy a website to another account, enter the website in Copy this website.
- Enter the username in To account — an account you manage.
- Enter the New address for the copy.
- Choose the options and click Copy website.
| Option | What it does |
|---|---|
| Replace the old address in the database (apps other than WordPress) | a plain replacement of //old-address with //new-address in the copied database; WordPress is always changed with its own tools |
| Set up free SSL straight away | tries a free certificate for the new address at once; otherwise AutoSSL follows once the DNS points here |
The files are read as the first account and written as the other one; the database is copied into a new database of
the other account, and wp-config.php or .env is pointed at it. Mail is not copied. For other apps, the message
shows the new database name, user and password to put into the app's settings. Both accounts must be on the same
server.
Package limit
Server Admin › Accounts › Packages has Template size (MB, 0 = unlimited): the biggest template a customer of that package may save. Shared templates saved by staff have no limit.
Events
The hook events site.cloned, template.created and site.from_template are raised (see
Event hooks); the API endpoints are in API: site templates.