Jump to content

URL change...Can I copy/paste templates and fields?


kuba2
 Share

Recommended Posts

Hello

I have to move a website to a new adress because the URL changed.

Can I copy all the templates and fields and contents in the fields from processwire and somehow install it in the new address/database?

Or do I have to make the content all over again?

 

thanks for all help

Jakob

Link to comment
Share on other sites

Yes, you can duplicate your site on a new domain. There are modules that will help you do this but I'm a bit old school and prefer to do it manually when moving PW sites.

  1. Take a copy of the database, either with the ProcessWire module, DatabaseBackups or via PhpMyAdmin and download to your PC
  2. Download all your PW files to your PC, especially site/config
  3. In your new site, create a MySQL database and make a note of the db credentials
  4. Import your database sql file via PhpMyAdmin
  5. Upload your files to the new domain
  6. Edit your site/config.php file to include the new database credentials and the http hosts to the new domain name
  7. Clear your cache, especially ProCache if you use it

Should then be all good to go

PS: It's important to use your original site/config.php file as it contains the password salt for the original database

 

  • Like 6
Link to comment
Share on other sites

Thanks for Your answer. I have a follow-up question.

The "new" website is on the same server/hosting...does this mean I can use the old database and "link" it to the new website?

If I use the same site/config...would this new site use the existing database in the same manner as the old site does.

Thanks for all Input. I have no experience with databases, but the idea above makes sense to me. hope this is doable like that.

 

Thanks again

Link to comment
Share on other sites

@kuba2

1. yes

2. yes, after you've uploaded all the PW files to the new domain name folder

When the new website URL/domain name is on the same server/web hosting account and has access to the same database, all you need to change is the site/config.php https hosts array to accept the new URL(s). Easy, peasy, lemon squeezy ?

PS: either put the new URL(s) at the start of the $config->httpHosts array to give them priority or remove the old ones to prevent PW confusion

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...