Jump to content

Duplicate my website to my local environment


Rodd
 Share

Recommended Posts

Hi everyone!

I have a website in a production environment and I want to duplicate it in a local environment. I exported the content of the website (with the 'Site Profile Exporter' module) but I cannot use it actually. I've got an issue with the database. I imported this one in MAMP then.

I also exported the pages (with the 'ProcessPagesExportImport' module), but I cannot import it to my local website because the fields don't exist. So I created this fields, but I have this error :

Quote

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'field_video' already exists

How can I use the elements that already exist and are presents in my database? How can I duplicate correctly the templates, fields and pages?

Thanks by advance

PS: Sorry if my english is bad

 

Link to comment
Share on other sites

Hello,

I do not have much experience with site profile exports, I tried it out when I first started using ProcessWire but I have not used it ever since. So I cannot help you in that regard but you might want to consider different approaches as well, see:

https://processwire.com/talk/topic/17302-working-on-a-webproject-with-pw/

I hope this helps.

  • Like 3
Link to comment
Share on other sites

Thank you both to answer me.

On 6/21/2020 at 9:50 PM, rick said:

This may help.

 

rick I tried your solution but it doesn't work 500 Internal Server Error ? even after have changed my config.php

szabesz I already saw the propositions of people who participate at this discussion

Link to comment
Share on other sites

"500 Internal Server Error" may be a red herring - it seems to be PW's way of avoiding display of plain old PHP errors on the front end on a production server. Can you see the PHP error log on your hosting? Do you get the error when you log in to the back end? if you can log in, Tracy will be your friend.

 

  • Like 1
Link to comment
Share on other sites

Hi everyone!

I almost did it. So I'm gonna share what I did for people who can have the same issue

I checked my log first, and I saw that I was connected with the guest user and not the admin user. Anyway, I uninstalled the project and reinstalled a new one.
For this, I created a new project with the master version of Processwire (with the multi-language option). I replaced the content of my database by the database that I have for my website in production - same tables, same fields, just content which is new.
Then, I put the templates that I have on my Gitlab plus modules and assets. I used the 'ProcessPagesExportImport' module and saw what I had to do for fields and templates before to import my pages. Almost all of my pages are on the website in the local environment.

But I still have a problem. This is the error that I have.

Quote

Fatal Error: Uncaught Error: Call to a member function setLanguageValue() on null in /Users/ilyas/Documents/yuzu-gaming/wire/modules/LanguageSupport/FieldtypeTextLanguage.module:144
Stack trace:
#0 /Users/ilyas/Documents/yuzu-gaming/wire/modules/LanguageSupport/FieldtypeTextareaLanguage.module(114): ProcessWire\FieldtypeTextLanguage->___importValue(Object(ProcessWire\Page), Object(ProcessWire\Field), Array, Array)
#1 [internal function]: ProcessWire\FieldtypeTextareaLanguage->___importValue(Object(ProcessWire\Page), Object(ProcessWire\Field), Array, Array)
#2 /Users/ilyas/Documents/yuzu-gaming/wire/core/Wire.php(392): call_user_func_array(Array, Array)
#3 /Users/ilyas/Documents/yuzu-gaming/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___importValue', Array)
#4 /Users/ilyas/Documents/yuzu-gaming/wire/core/Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\FieldtypeTextareaLanguage), 'importValue', Array)
#5 /Users/ilyas/Documents/yuzu-gaming/wire/core/PagesExportImport.php(957): ProcessWire\W (line 144 of /Users/ilyas/Documents/yuzu-gaming/wire/modules/LanguageSupport/FieldtypeTextLanguage.module)


This error message was shown because: you are logged in as a Superuser. Error has been logged.

So yeah I installed the FieldtypeTextareaLanguage module, and used it for a field, but I don't understand why I've got this error. I installed the repeater module too, and there is no problem with it.
Maybe someone can help me for this?

Thanks by advance

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

×
×
  • Create New...