We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40447
    • 165 Posts
    Hi,
    After finished building a website on your laptop and have it uploaded to a host, I see no reason to stop with the website on your laptop, and only edit/update the website on the host. On your laptop:
    1. You will have a working backup
    2. Editing/updating on your laptop (local) goes a lot faster
    3. You can edit/update the site even off-line
    4. Most of the time edits and updates don't need to be active on the website,
    the same day, but have them updated on the host the following day. So you can use some ftp program and schedule it to update your website overnight in idle time. And from here comes my question.
    I have noticed that when synchronizing from the root, a lot of files in the assets and manager folders are synchronized for nothing because these files never change. This is a waist of time. Is it possible to put all your website pictures, css, js, etc, in a single folder, let's say a subfolder in the assets folder and call it "mysite" and synchronize your website from this single subfolder ?
    Apart from when you added new plugins or modules, are there any other folders or files in the modx root that need to be synchronized as well for not breaking your website on-line ? Greetings Brian.

    This question has been answered by BobRay. See the first response.

    [ed. note: sitecms last edited this post 13 years, 9 months ago.]
      • 34084 ☆ A M B ☆
      • 756 Posts
      You will want to grab all folders from the root web folder including assets, manager and core. In that sync process you'd want to exclude the /core/cache/ folder and any of the config.inc.php files as they change based on environments.

      Cheers
        Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
        Visit CharlesMx.com for latest news and status updates.
        • 40447
        • 165 Posts
        Charless, I guess what you are saying is when you upload a finished site from laptop to the host. But I was thinking about keeping the website also on the laptop after that. Then doing edits and updates on the laptop and synchronize them overnight with the site on the host. The idea is to put all pics, css, js, etc. in 1 folder. So if you do updates/edits on one of them you have to synchronize only 1 folder between the laptop and the host. This can be done with a sync ftp program scheduled at idle hours (overnight) I am not sure however if there are more folders in the modx root that need to be synchronized as well to keep everything working after doing some updates/edits. In the assets folder I noticed a folder named "site". Perhaps this folder is already meant for this purpose ? [ed. note: sitecms last edited this post 13 years, 9 months ago.]
          • 40045
          • 534 Posts
          Sure you can do that and assets/site/ is a good location for it, but what I don't see is the type of updates you're making? Are we talking about css/js updates or content updates? I hope your content is in the database? =) but then you need to go into the manager anyway...
            • 3749
            • 24,544 Posts
            The only files MODX will update on its own are in the core/cache folder. You don't want to transfer those.

            The assets folder is definitely a good place for your files. MODX won't mess with it during upgrades
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 40447
              • 165 Posts
              Thanks Bob and exside.
              The only files MODX will update on its own are in the core/cache folder.
              That's what I was actually after. To know what files modx is updating by it's own. We'll if it's only the cache that means it is safe to synchronize only between 2 subfolders inside the assets folders on the laptop and on the host. Things that are in the database I can update by exporting the local database and importing it on the database on the server. There are php scripts out there who can do that automatically.
              Maybe you ask yourself why I would do all this. We'll I think it would be a better way of working, to not only work through the manager on-line but also local on your laptop. Both ways ! I see 4 good reasons for this: 1. You will have a working copy on your laptop 2. Working on a site goes a lot faster locally on your laptop 3. You can work on your site even if you are off-line 4. New Edits and updates done on your site don't need to be done on the same day on the host. It would be ok on the next day so you can simply synchronize the site between your laptop and the host, overnight with ftp sync. There are lot's of ftp or php scripts out there that lets you synchronize scheduled automatically.
              Modx3 seems to be around the corner. Wouldn't it be a great feature to have in Modx3 to be able to synchronize a site between your laptop and the host ? So that you can work on your site through the manager, both on your laptop locally and on the host ? What do you think ? Greetings Brian.
              [ed. note: sitecms last edited this post 13 years, 9 months ago.]
                • 40045
                • 534 Posts
                =), I also have seen Chris Coyers talk about "A Webdesigners Workflow" where he more or less lists the points you do promoting local developement. I tried but I'm not happy with that kind of workflow, I just have made the experience that if I developed a site locally then pushed it to the live server, nothing worked^^...and when you're close to a deadline and this happens, it basically sucks, so I like to develop on the "live" site or on a dev site under a subdomain or so, but just in the server environment the site will actually live in.

                I definitely do see the advantages of working locally, but I just like my actual workflow so much better that I dont want to change. So I think this is a very individual preference and has not so much to do with modx itself because the workflow of changing/publishing is left to every developers own preference.
                  • 10208 ☆ A M B ☆
                  • 1,780 Posts
                  I think this largely depends on how much developing you're doing. If you're simply updating images or changing css/js you can use the folder method and update the files whenever you want. Your local copy would not need to match the live one exactly. But if you're changing content at all, you need the database. If you're changing tv's/chunks, or let's say, utilizing or adding new snippets, you again need the database plus whatever files the snippet/tv/chunks call for. Change or add a chunk, you need db again.

                  The ideal scenario would be to push the entire install to your local machine with an automatically updated config (or omitted), do updates, then push back to the live server. There's no one (few) click option for this at the moment which means this would take significant "work" for each update session. Room for error with this method is high, I can see lots of config issues if not done correctly every time. Not for the average user/editor, and certainly not ideal for an every day task.

                  The other option would be to make everything that you might change static files. Maintain the element names and static file name/locations, then upload the new static files overriding the old ones. Again, not for the average user/editor who only understands WYSIWYG (aware that you're wanting this for development users, but I thought it worth mentioning).

                  Keeping all the static files in one directory for "ease of updating", regardless of where they should be would not be ideal. One would have to make sure to upload every modified directory to the site rather than just the one.

                  Regardless, if it's just js, css, and some image file replacements (same file names) I think you're safe with the one folder/upload later method.
                    Frogabog- MODX Websites in Portland Oregon
                    "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                    Having server issues? These guys have MODX Hosting perfected - SkyToaster
                  • discuss.answer
                    • 3749
                    • 24,544 Posts
                    Be careful when updating the database. You can make a real mess for yourself that way. There are paths in there (e.g., the modx_workspaces table) that are different for different hosts and will crash the Manager if wrong. There are also properties and settings that are set by extras that point to specific resources or elements (by ID) that might have different IDs in the two installs.

                    It's easy to introduce an error that may not show up right away and may be very hard to diagnose later.

                    TBH, I generally cut and paste between a localhost install and the remote. It's not as efficient, but it's much more disaster-proof.

                    An alternative would be to use file-based resources and elements and just transfer the files, which you can deploy through any good code editor.
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 34084 ☆ A M B ☆
                      • 756 Posts
                      are you using both the local and remote for content editing? that also has an impact on what the process would look like, having personally to work with a three tier redundant setup there are more granular items that you have to have some logic in place to handle in order to make this happen successfully otherwise using your current process you will lose all remote content updates and also end up with orphaned static files.

                      if you are planning on just doing content edits and system management (package management, system settings, lexicon, etc) the others recommendations are on the right track. if not then you will need to get much more complex tools like,me DB diff and file diff and sync tools to use.

                      cheers
                        Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                        Visit CharlesMx.com for latest news and status updates.