How to include database in website deployment? - database

I try to setup a deployment workflow, but I am completely new to it. I consider to use Git and Bamboo and in this whole thing I am stuck with the database.
Let's say I want to make changes on a CMS website and keep my files versioned on git (bitbucket), I understand how to setup Bamboo that it can SCP the files to my webserver, but I don't get it how I can get the database into this whole system? Are there any tools I am missing?
What I want:
I want to be able to checkout my website files from the gitserver, make changes and send them back to the gitserver and this (via Bamboo) should push the files to the live or testserver.
But even after searching for hours, I don't get a smooth way how to handle the database (getting it local, making changes and pushing it to the server via git) or any other smooth way.
I know there are tools to quickly dump the db for WordPress sites, but for other CMS there are no such tools.
Any advice how to do this right?

Related

Is there a way to backup/export & import Strapi data

So I am at the place where I lost all of my Strapi data after moving from local to remote host and deploying my Strapi through herokuapp.com
I am using Strapi in my personal NEXT.JS project.
Luckily my Strapi database wasn't so huge and all content-types were kept so I was able to recreate the database quite quick. Also this was just a personal project.
I am wondering though, if I decide to push Strapi to use in in more professional context and in real project – how do I move from local development to deployment without loosing all data?
Is there a way to export everything before deployment and then import it into the deployed CMS or how does this work?
Also – what if I want to do it the other way around? I will keep working on my app using my Strapi on Heroku but at some point I will want to replicate the CMS locally. Where is the data stored and how do it get access to it?
From docs: "Strapi does not currently provide any tools for migrating or deploying your data changes between different environments (ie. from development to production). With the exception being the Content-Manager settings"
And there is no export/import content for now.
To export your data for example from the local environment to the production you have to handle:
content-types - Strapi store this stuff at files so version control will help
database data - you have to make database backup manually and then import data at the production server
static files - if you use Srapi to handle the static files you probably will have to copy them manually and import them to the production server or use version control for it (bad option). They are stored at app/public/uploads
I didn't tried this myself but it looks like a pretty tough task.
Conclusion: if it's OK for you to migrate only your content types, just put a git on your Strapi folder
You can do it via the CLI now, new from version 4.6.
Strapi supports export, import, and transfer.
To create a tar of your data:
npm run strapi export --file my-strapi-export
To import data into your project:
npm run strapi import -f export_file.tar.gz
There are more options in the docs:
https://docs.strapi.io/developer-docs/latest/developer-resources/data-management.html#export-data-using-the-cli-tool
With the new data export & import system, you can backup & restore
your Strapi project data without acting manually and directly into the
database.
More info: https://strapi.io/blog/announcing-strapi-v4.6
Keep in mind Heroku is in the middle of shutting down its free tier, so using another provider like railway.app or render.com might be a good idea.
Anyway: As Eugene already mentioned in his answer there are 3 types of data that might have to transmitted (content types, the actual database, and files).
After your first deployment to Heroku you should end up with all content types being there, but with an empty database and no files.
Following this guide you will create an own database while setting up your project where you can now either export and import your database from your local development environment (which you would have to do manually) or put in new data by hand. Sometimes this is even better since development environments tend to include a lot of "Lorem Ipsum" content for testing purposes.
Future deployments should not reset your database though but keep your data from that environment.
Finally there are the files which I would recommend to store on Cloudinary since it's free, and Strapi offers an easy-to-use plugin for it. Just create a free account on Cloudinary, install the plugin in your Strapi project, and set your ENV variables for your production environment within Heroku.
I found this
Apparently they recently did a plugin tutorial that had to do with this issue. There is a plugin called strapi-plugin-import-export-content on git hub that might be able to help your issue.
git hub link

1st - How does Heroku interact with a database (sqlite) 2nd - How can I obtain the version of database that is on Heroku?

I had a very hard time trying to find solutions to this problem online, probably because I do not know how to phrase this weird problem. I also could not reach out to Heroku as their support team only serves paid customers. I would really appreciate help from anyone.
Some context:
I have recently started experimenting with Heroku and deployed my first web app (Python, Flask, SQLite3) via GitHub. It works as intended, I am even able to interact with my database (add/delete/update). However, after making an update to my code locally and pushing it to GitHub, I realised that when my web app got built again by Heroku with the updates, the changes I made to the SQLite database is reverted back the initial, local version. (aka I lost the updates I made during testing).
So here comes the first question:
How does Heroku actually interact with the database? Does it create a copy of all my code from GitHub and runs it locally on their servers? (Since no changes to the database are reflected in my GitHub Repo despite successful updates to the database values through the web app).
And if so, this is the second question:
Is there any way for me to get this "updated version" of my database from Heroku side so I can download it locally before I make and push any updates to my code, so as not to erase all the updates to the database that a user might have made through the web app?

Copy Drupal site to staging mode using cli

I am quite new with Drupal and trying to follow the community documentation, in order to copy a live site to a test site using cli. But, all I accomplished so far is to backup the database and modify the .htaccess file located in public_html/staging_directory, which I accessed through the terminal (ssh).
I would really appreciate if anyone has any feedback if I am on the right track with this link, or where to go from here as far as copying the contents of the live site.

Database app, accessible from Mac, iPad and Web

I feel very out of my depth with this query, but not being able to do it isn't really an option so I am going to have to learn how one way or another.
I have been tasked with building an application / database for a Chauffeur company. I have done similar things before in Microsoft Access for other customers, hence getting this request, but this customer wants to be able to run the app on their Mac, and not install Windows. My only real experience of coding is HTML/CSS and some VBA when using Microsoft Access. For these Access DBs I have created separate front and back end files to allow multi user access and also remote access (the back end file being kept on the company server).
So onto my query (apologies for dragging it out)...
I need to be able to build something that the single user can open and run on his Mac, so he can view, add, change jobs and their details. He also needs to have the same access on his iPad, although purely viewing would suffice.
As regards the web access, basically he wants to be able to go onto his "Booking System" application, go to "New Job" and send a link to his client, where they would click the link in a browser, fill in the details (Name, Contact Number, collection and drop off addresses, collection date and time etc...) and when they submit this form the details be updated on his booking system.
My issue is I do not really know where to start. I just need some pointers as to where to get started. Is it an issue of building a MySQL database back end and then hosting this somewhere and linking different front ends to it etc...
Yes, with multiple clients, the web is your best answer. For the cheapest hosting route, you can find good, inexpensive PHP and MySQL hosting that will provide what you need. You can design the front end with HTML/CSS, use PHP to develop the logic and data access, and use MySQL to host the data.
The Mac and iPad can access the application via the web URL--you will not be building an iOS app, rather the user will access the web site through a web browser. You can use some pretty neat tools like jQuery UI Mobile to create an app-like experience, but if you need to support multiple clients on a small budget, an iOS app and separate web site is not the way to go.
Make sure you have some PHP expertise available or figure this part out. There are tons of great resources on the web to get started. Good luck!

connection between postgresql db and application(jsf+hibernate) running on cloudfoundry

The application(JSF+hibernate) is been deployed using the vmc commands as on the cloudfoundry site. able to see the welcome page. postgreSQl service is binded with the application but the application is not able to connect with the database.
And also viewed about the VCAP_SERVICES using java but dont know much about it rather how to create it.
Cloud Foundry uses auto-reconfiguration if you have one service (either MySQL or Postgres) bind to your application. That means you don't need to touch your code at all!
Please review the following article on our docs site:
http://docs.cloudfoundry.com/frameworks/java/spring/spring.html#using-cloud-foundry-services-in-spring-applications
If you still have issues, go ahead and upload a war file of your app and we can take a look.

Resources