Making an entire website available offline? - wordpress

Consider this scenario:
I could use a CMS, say Wordpress, to create a product catalogue, where my products are effectively tagged and categorised for ease of navigation. For employees and customers, this would provide an effective and visual means to browse a catalogue of products.
The problem with this is that it requires a connection to the internet to serve up the information. There could be many situations where the users of this catalogue are not connected to the internet, but still need to browse the catalogue - like field sales staff, for example.
How then, is it possible to make this entire site available for viewing (and distributing) offline? It would need to function exactly as the internet-connected version, serving up the same information and images.
Is it possible!?
I guess the limitation is the the WP database serves up the info and that would require everyone to have a MAMP-type installation, with Wordpress on their machines?

You could create a static mirror of the site e.g. wget -km http://DOMAIN. Package that into an archive and get them to install a new archive whenever it's been updated.

If you need it to function exactly, like you mentioned, you might want to check out XAMPP. It is a package containing an apache webserver, mysql, perl and php. It is not required to be installed before being used, but it does require starting the components which could probably be scripted.
The downside is you will need to customize this version unless you want to include all your information in the catalogs. Also, since your current server likely has different modules than what comes standard with XAMPP this could lead to having to basically maintain two versions of the site.

If you don't need the databases to sync (e.g. portable POS systems), MAMP is a great solution. I've implemented this several times in cases where field agents required web-based promo materials. Easy to update, maintenance free, small learning curve. MAMP all the way.

I'm developing a Wordpress site, mirrored locally under http://localhost. I'm able to transfer the database with a simple plugin that handles backup, then before I load locally I remap the URI strings inside the SQL. Being PHP serialized, some care is needed to keep the string size aligned. I.e. change each occurrence of s:N:"...http://your_site/" to s:M:"...http://localhost/your_site/", with M = N + 10.

Related

How do you make an R coded program running on AWS accessible from your website?

In the creation of a simulation for our company, we coded the entire thing in R. It runs on AWS, and the consumers have been given links that route to the AWS page. Our website, however, is currently running off of Wordpress. In order for our customers to be able to access the product, we need to find a way to connect the product to the website. We would hence like to replace the current site with a new one that allows users to access our simulation from the website.
The only option we’ve come up with is to create a separate domain that has the interface built into the R program, and have a link to that domain from the current website. However, we would prefer to have a more direct solution.
Do any of you have any suggestions as to how we might achieve this?
Thanks for your time!
This answer very much depends on your code, but I think you have several options.
Run on external website
Pros:
Full control over code, easy to update without risking changes to main site
Easily accessible either by directly linking to it, or using <iframe> (HTML) on your main website, no Wordpress support required!
Cons:
Separate domain, some extra costs (?)
Shinyapps.io
Pros:
Easily publishable, often free
Cons:
Available for mostly everyone, which might not be ideal in a business situation
Less control over the platform
EDIT: I wanted to add that you can host your own shiny applications, and build the front-end using HTML. This gives you some more control.
AWS
Pros:
You should be able to set up an instance where the simulation is run on a subdomain that is not directly tied to Wordpress, e.g. outside of the main Wordpress folder.
As I said, the ideal solution depends on your code. Does it take user input, does it need to save files often? What kind of access control do you need?

CMS - How to work with multiple environments? Do I really need them?

I've never worked with any CMS and I simply wanted to play with such ones. As originally I come from .NET roots, so I was thinking about choosing Orchard Core CMS.
Let's imagine very simple scenario, together with my colleague I'd like to create a blog. As I'm used to work with web based systems and applications for a business for me it's kinda normal to work with code repository, having multiple environments dev/test/stage/prod, implementing CI / CD, adjusting database via migrations or scripts.
Now the question is do I need all of this with working on our blog with a usage of CMS.
To be more specific I can ask few questions:
Shall I create blog using CMS locally (My PC) -> create few articles and then deploy it to the web or I should create a blog over the internet and add articles in prod environment directly.
How to synchronize databases between environments (dev / prod).
I can add, that as I do not expect many visitors on a website I was thinking to use Orchard Core CMS together with SQLite. Also I expect that I can customize code, add new modules, extend existing ones etc. - not only add content (articles). You can take that into consideration in answering the question
So basically my question is what should be the workflow of a person who want to create / administer and maintain CMS (let it be blog) as a single person or as a team.
Shall I work and create content locally, then publish it and somehow synchronize both application and database (database is my main question mark - also in a context how to do that properly using SQLite).
Or simply all the changes - code + content should be managed directly on a server let's call it production environment.
Excuse me if question is silly and hard to understand, but I'm looking for any advice as I really didn't find any good examples / information about that or maybe I'm seeking in totally wrong direction.
Thanks in advance.
Great question, not at all silly ;)
When dealing with a CMS, you need to think about the data/content in very different terms from the code/modules, despite the fact that the boundary between them is not always completely obvious.
For Orchard, the recommendation is not to install modules in production, but to have a dev - staging - production type of environment: install new modules on a dev environment, test them in staging, and then deploy to production when it's safe to do so. Depending on the scale of the project, the staging may be skipped for a more agile dev to prod setting but the idea remains the same, and is not very different from any modular application.
Then you have the activation and configuration of the settings of the modules you deploy. Because in a CMS like Orchard, those settings are considered data and stored in the database, they should be handled like content. This includes metadata such as the very shape of the content of your site: content types are data.
Data is typically not deployed like code is, with staging and prod environments (although it can, to a degree, more on that in a moment). One reason for this is that a CMS will often feature user-provided data, such as reviews, ratings, comments or usage stats. Synchronizing all that two-ways is very impractical. Another even more important reason is that the very reason to use a CMS is to let non-technical owners of the site manage content themselves in a fast and direct manner.
The difference between code and data is also visible in the way you secure their changes: for code, usual source control is still the rule, whereas for the content, you'll setup database backups.
Also important to mention is the structure of the database. You typically don't have to worry about this until you write your own modules: Orchard comes with a rich data migration feature that makes sure the database structure gets updated with the code that uses it. So don't worry about that, the database will just update itself as you deploy code to production.
Finally, I must mention that some CMS sites do need to be able to stage contents and test it before exposing it to end-users. There are variations of that: in some cases, being able to draft and preview content items is enough. Orchard supports that out of the box: any content type can be marked draftable. When that is not enough, there is an optional feature called Deployments that enables rich content deployment workflows that can be repeated, scheduled and validated. An important point concerning that module is that the deployment only applies to the subset of the site's content you decide it should apply to (and excludes, obviously, stuff like user-provided content).
So in summary, treat code and modules as something you deploy in a one-way fashion from the dev box all the way to production, with ordinary source control and deployment methods, and treat data depending on the scenario, from simple direct in production database instances with a good backup policy, to drafts stored in production, and then all the way to complex content deployment rules.

Use a purchased template in testing environnement

I received the task to build the website of a little company and they wanted me to build it with concrete5. They have also chosen and purchased a theme, but only one licence.
Since I want to build the website on my local machine first, I wanted to ask if there is a possibility to migrate websites with purchased themes once I finished building it on the local machine, even if we have only one licence (since the theme would then basically bee used twice ; also when purchasing a theme, they ask to assign the licence a project, making it only available for this one).
This is totally fine, the license is for one site, not one install. So staging environments are totally OK. You might have to get your client to add your URL for automatic updates, but I'm not sure on the process for that. You can just FTP or rsync the files down and install locally, though.
Really, all that the actual mechanism behind checking the licenses does is to show you when there are updates, which, if you're going to be customizing the theme at all, you might not even want. Otherwise, the client could see there's an update and blow away your customizations. So in that case, you might not even want to associate the license with the marketplace at all, instead just leave it unassigned and download a copy of the files manually.

What is the best way to merge development database with production?

We develop WordPress websites and we have returning customers who request revisions to their website that require us to develop in a development environment before publishing to production (live). The challenge has always been how to merge two WordPress databases that are out of sync but have mutually new content that must be retained.
This content ranges from Pages, Posts and Comments to Plugin settings and other subtle information. So we export both databases and use FileMerge, for Mac, to display the differences and manually merge them. This would be fine if the WordPress databases didn't contain so much meta information that is, otherwise, human unreadable (examples below).
My question is whether or not someone out there has a recommendation on how to solve this problem? Essentially if we could just omit the items below (assuming that's safe to do?) then we would be perfectly happy continuing to use FileMerge. But with those items it makes it feel like we're decrypting the worlds longest password.
FYI WP Migrate DB (including Pro) is not capable of this. We spoke with the authors.
Thanks.
The following is a list of database records that I think could be omitted without causing any conflicts in the database.
- _transient_random_seed
- active_plugins "a" value (which I believe represents the number of active Plugins)
- _site_transienty_timeout_browser
- recently_edited
- db_version
- cron
- _transient_timeout_feed_mod
- _transient_feed_mode
- rewrite_rules
- Plugin Versions
- _edit_locks
I've been looking at two potential solutions to this problem, however both have the limitation of requiring php exec() on the development/staging server. So hosts like wpengine (which we're using) won't work with them.
If this isn't a limitation for you then check out https://revisr.io/ or http://versionpress.net/
Revisr is open source and VersionPress is currently using a paid Early Access Program to support development. Both use git to manage all aspects of Wordpress syncing from the WP-Admin.
Try MySQL Data Compare from Red Gate. I use the MSSQL version myself and its one of my favorite development tools. You can select exactly which tables and even the individual records you want to sync. Now for the bad news it only runs on Windows and it is not cheap.
If I wouldn't be developing on a Windows machine myself I would buy one just for this program.
http://www.red-gate.com/products/mysql/mysql-data-compare/
I'm looking for the same. The closest I got was WP Stagecoach which is one of the few things out there that actually merges data! The downside is you create a dev site from the the live site - which means you have to do all your changes on there... you can then merge back with the live site (data and files).
It means you can't work locally and have to do it on the Stagecoach servers.
Also, one thing to keep an eye on is Datahawk, there's no timeframe of when they will release it but it's from the WP Migrate DB Pro guys... I've been told by the developer it will handle merges, how this turns out though I don't know.

Build an Offline website - Burn it on a CD

I need to build a website that can be downloaded to a CD.
I'd like to use some CMS (wordpress,Kentico, MojoPortal) to setup my site, and then download it to a cd.
There are many program that know how to download a website to a local drive, but how to make the search work is beyond my understanding.
Any idea???
The project is supposed to be an index of Local community services, for communities without proper internet connection.
If you need to make something that can be viewed from a CD, the best approach is to use only HTML.
WordPress, for example, needs Apache and MySQL to run. And although somebody can "install" the website on his own computer if you supply the content via a CD, most of your users will not be knowledgeable enough to do this task.
Assuming you are just after the content of the site .. in general you should be able to find a tool to "crawl" or mirror most sites and create an offline version that can be burned on a CD (for example, using wget).
This will not produce offline versions of application functionality like search or login, so you would need to design your site with those limitations in mind.
For example:
Make sure your site can be fully navigated without JavaScript (most "crawl" tools will discover pages by following links in the html and will have limited or no JavaScript support).
Include some pages which are directory listings of resources on the site (rather than relying on a search).
Possibly implement your search using a client-side technology like JavaScript that would work offline as well.
Use relative html links for images/javascript, and between pages. The tool you use to create the offline version of the site should ideally be able to rewrite/correct internal links for the site, but it would be best to minimise any need to do so.
Another approach you could consider is distributing using a clientside wiki format, such as TiddlyWiki.
Blurb from the TiddlyWiki site:
TiddlyWiki allows anyone to create personal SelfContained hypertext
documents that can be published to a WebServer, sent by email,
stored in a DropBox or kept on a USB thumb drive to make a WikiOnAStick.
I think you need to clarify what you would like be downloaded to the CD. As Stennie said, you could download the content and anything else you would need to create the site either with a "crawler" or TiddlyWiki, but otherwise I think what you're wanting to develop is actually an application, in which case you would need to do more development than what standard CMS packages would provide. I'm not happy to, but would suggest you look into something like the SalesForce platform. Its a cloud based platform that may facilitate what you're really working towards.
You could create the working CMS on a small web/db server image using VirtualBox and put the virtual disk in a downloadable place. The end user would need the VirtualBox client (free!) and the downloaded virtual disk, but you could configure it to run with minimal effort for the creation, deployment and running phases.

Resources