Jump to content

Recommended Posts

Hi everybody!

I have been reading about Multisite, but it kinda bugs me that every topic talks about having both admin and database same for multiple sites.

I have a project where customer tests it by adding content to the site, while I still need to do some changes here and there in code, maybe some in database. If something crashes for a while, customer can't keep testing, which is a bit problematic.

Is there any way that I could have two separate versions of one site ("production" and development) that share the same database, but are otherwise independent? Just the thought of having to migrate database every time I want to show client something new gives me anxiety 😁

Share this post


Link to post
Share on other sites
3 hours ago, iipa said:

Is there any way that I could have two separate versions of one site ("production" and development) that share the same database, but are otherwise independent?

What do you mean by "otherwise independent"? It is easy to have two pw instances connecting to one DB (just put the same in config.php), but that makes no sense in a production/dev environment. Adding a field to one site means you'll also have it in your other site. If your code does not reflect that (in BOTH instances), you'll get into trouble (php errors). And you don't want to have those DB changes on the live system instantly of course! Imagine you want to try adding a new "lorem ipsum" news entry... you'll instantly have it on your live system!

You have two options:

1) Duplicate your live website to the dev environment, make changes, test everything, push the changes back to live
--> this works only if you don't have any changes to the DB on your live system while you are developing/testing on your dev system

2) Migrations
https://processwire.com/blog/posts/introduction-migrations-module/
https://weekly.pw/issue/261/#new-module-rockmigrations (thx @teppo for listing it)

  • Like 1

Share this post


Link to post
Share on other sites

Hmm, that's a good point. There certainly are some risks that come with having the same database that I haven't considered. Thanks for pointing them out!

First solution doesn't work in this case, because client wants to test how things work with adding real content, so they probably wouldn't like the idea of things being wiped with every update.

The second option with migrations sounds cool though - might be just what I need!

  • Like 1

Share this post


Link to post
Share on other sites

Another (rather lo-fi) setup could be:

Use dev template files, as alternative templates. For testing out new content, you can leave pages unpublished and still preview them when logged in.

If your client (role) has permissions to switch templates with Tracy Debugger, there the template switcher panel you could use.

https://processwire.com/blog/posts/introducing-tracy-debugger/#template-path-panel

https://processwire-recipes.com/recipes/use-different-sets-of-template-files/

  • Like 2

Share this post


Link to post
Share on other sites

Wow, that sounds nice as well! And fairly easy to implement too. You know what they say, work smart, not hard!

  • Like 1

Share this post


Link to post
Share on other sites

I had some issues with server provider and subdomain SSL certificate (I want all my sites use forced https), but after those were resolved, @dragan's solution works perfectly! So thanks again, now I'm able to use actual data also in testing phase, which helps in UI design.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By DooM
      Hello guys,
      I'm trying to figure out how to sync fields and templates between staging and production environments.
      I've found Migrations module by Lostkobrakai, but with use of it all the fields and templates must be created by API, which is kind of uncomfortable.
      I also tried ProcessDatabaseBackups module which can export only certain tables, but I don't think it's the best practice to do that.
      How do you guys solve this problem? It's very annoying to setup everything three times (dev, staging, production).
      Thanks a lot :)
    • By sins7ven
      Hi community, I am wondering if its possible to display languages based on what host/domain has been requested.
      The use case is the following: I have one installation of PW - and within this installation I set up 5 different languages (default, english, spanish, french, dutch). Now I have 3 different domains (domainA.com, domainB.com, domainC.com) and I want to decide which languages to make available based on what domain has been navigated to. 
      For example:
      domainA.com
       - default (domainA.com)
       - english (domainA.com/en)
      domainB.com
        - default (domainB.com)
        - french (domainB.com/fr)
        - dutch (domainB.com/nl)
      domainC.com
        - default (domainC.com)
        - dutch (domainC.com/nl)
      So what I want to achieve is making only these particular languages selectable in the language switcher on the frontend. Since all pages share the same templates and overall site structure I don't see the benefits of running this installation as a multisite setup or would it be better to do so? But I assume that this would be difficult to handle since the default language might change as well. (On the french version of the page, french should be the default language and so on). Any suggestions how to accomplish that? Thanks!
    • By Falk
      Hi!
      After temporarily using Module Image Extra, which I completely removed, I had some troubles with my imagefield (unused table columns).
      So I just imported a previous version of this column via PHPmyAdmin, which worked pretty well.
      Anyways, in Processwire Backend all image tags are gone, although they are OK in the database.
      Other image related things work (thumbnail, title etc are OK).
      Is there any way to recreate all the images or something? Or may this be an cache-related issue?
       
      Thanks in advance 😃
       
    • By Peter Knight
      Hi guys
      Is it possible to have a PW site display content from another PW site?
      I've been reading about ProcessWire's Multi-site options and I don't think either is a way forward for me.
      Both PW sites are separate installs with separate databases but crucially they are on the same VPS. So I'm hoping that's a good thing.
      Basically, Site A has approx 100 reviews consisting of these fields
      Reviewer name Review Date Instead of setting up the fields onto Site B and duplicating work and creating 100 pages, I want to *somehow* get site B to use a selector to fetch the necessary content from Site A.
      In future, if I need to update the reviews, I can goto the 'source' Site A to do this.
       
    • By Guy Verville
      I know it is possible to have a different domain name for each language of a site. For exemple:
      monsite.com (for French) mysite.com (for English) I know also that we can have several sites in one installation with the help of Soma's Multisite module.
      I have a company who has four independent sites (four different companies under a same umbrella). The new design and structure of those sites will be practically identical. There will be different administrators for each site, but a lot of data will be shared, so using Soma's module seems to be a good idea. The problem is that those 4 sites have different names for the French and English version.
      compagnieUn.com (for French) companyOne.com (for English) compagnieDeux.com (for French) companyTwo.com (for English) etc. Will we shoot ourselves in our feet to develop with just one installation? Would it be preferable to make those sites able to talk to each other instead?
      Your input would be very much welcome!
×
×
  • Create New...