Jump to content

Copying architecture(database+templates) from one PW project to another


Ksenia
 Share

Recommended Posts

Hello! I am new to PW and while I got a hand of working with .php and coding templates, I am completely lost to how to adjust the file structure from one project to another?

The files that we copied from the server were stored like this:

1403920633_Screenshot2021-11-01at12_42_59.thumb.png.1323da6aa89873374b388a0745548ba3.png

While I have a very basic set-up that comes automatically and my main code is all in processwire/site/templates:

1055361497_Screenshot2021-11-01at12_43_20.thumb.png.ae9bee23a5c15fa845eba4b297c78484.png

As I understand, when you launch a project it looks for index.php and then for config.php, and of course it breaks if I just copy the structure in the folder (websites/processwire).

Basically, what I need is:

- all templates and fields 

- the pages tree itself (so not only the templates and fields, but also the tree structure using those templates and fields)

- all the data from inside the fields

But I do not know how to transfer this from the copied files and not get an error. And maybe my question is where does PW store the table with all the field types/ pages/ how data correlates the pages etc and can I copy it and just paste into my project? If you could guide me to options, I'll be very grateful! 

NOTE: I do not have access to the server with all the data, thats why we just copied the whole thing to adjust. 

 

 

  • Like 1
Link to comment
Share on other sites

Hi!

ProcessWire stores all its data in a MySQL database. You don't seem to mention that in your post so I'll give a wild guess that it's a part that might be missing. Is the copy of the project running locally or on a server? 

  • Like 2
Link to comment
Share on other sites

If you're trying to duplicate a site, and don't have access to mySQL, then there are couple of modules that may be helpful.

https://processwire.com/modules/process-database-backups/

This one can be helpful if you have an existing ProcessWire installation that's working, but need to restore data from a backup.

https://processwire.com/modules/process-export-profile/

This one is useful if you're starting a completely new install of ProcessWire and you want to recreate an existing site structure during the install process. This will include templates, site modules, and page structure. You need to copy the exported profile to the new site profiles directory before you install, so that it allows you to select the profile during the install process. This will recreate the database structure.

You will need to be able to set up a blank mySQL (or MariaDB) database and assign a database user with full access to it.

There are other migration modules if you have a development site and a live site, and you only want to transfer changes.

  • Like 2
Link to comment
Share on other sites

On 11/1/2021 at 4:47 PM, elabx said:

Hi!

ProcessWire stores all its data in a MySQL database. You don't seem to mention that in your post so I'll give a wild guess that it's a part that might be missing. Is the copy of the project running locally or on a server? 

Thanks for the response!

It is running locally on my computer but will run on a server, but I decided to install export/input module and it worked great for my purpose! 

23 hours ago, Kiwi Chris said:

If you're trying to duplicate a site, and don't have access to mySQL, then there are couple of modules that may be helpful.

https://processwire.com/modules/process-database-backups/

This one can be helpful if you have an existing ProcessWire installation that's working, but need to restore data from a backup.

https://processwire.com/modules/process-export-profile/

This one is useful if you're starting a completely new install of ProcessWire and you want to recreate an existing site structure during the install process. This will include templates, site modules, and page structure. You need to copy the exported profile to the new site profiles directory before you install, so that it allows you to select the profile during the install process. This will recreate the database structure.

You will need to be able to set up a blank mySQL (or MariaDB) database and assign a database user with full access to it.

There are other migration modules if you have a development site and a live site, and you only want to transfer changes.

Thanks, very helpful tips! 

I used export/input module and it worked pretty well for my goals for now!

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...