Backup websites with database in ubuntu server - database

I am having one ubuntu local server in which we used to have all our development websites. They all are php based sites. I would like to know whether we can have script or something to cron backup the files and database daily to external harddisc ?
Please let me know.

Here is the list of services, which should help you
http://jarvys.io - command line tool/service, that provides server backup to the cloud, simple restore process.
https://bitcalm.com - SaaS for the Linux server files and DBs backups. It has web ui to configure and manage the backups for all you servers. It backs up your data to Amazon S3 (you can use your own storage), recovery is really simple.
I don't have enough reputation to post more links. But you can google services like gobitcan, backuprun, tarsnap - all these are the services that can solve your problem too.

Related

Flyway migration with existing database using hasura - PostgresSQL Backup

I've develop a web platform that uses a PostgresSQL database along with Hasura to make GraphQL interface. This platform was deployed on a Google Cloud enviroment: the database is running in a Google Cloud SQL instance, the Hasura and a simple node.js servers are running on Cloud Run instances.
Anyway, since the database should keep growing, I need a secure and reliable way to keep track of changes done in development env to futher deploy it to production database.
The buck of the edits to the database schema are done using the Hasura Console and by now I just need a solution to track changes in data schema made in development enviroment to deploy only the needed changes to production
Reading about migrations I've found out Flyway as a solution to keep of these changes. However, there still some concerns about the implementation of Flyway in the project. But a couple of question arrise:
Is it possible to use the PostgresSQL (pgAdmin) backup generated files as migrations?
How could I make a migration from a development to the production database? Just by adding the remote url from Google Cloud SQL the do the migration?
There's no much need to keep track of changes of the data in production.
Is there a better option to control changes between development and production databases?
If a make frequent schema backup (using pgAdmin Backup tool) and run restore on the production database, it would do what I want?
Is it possible to use the PostgresSQL (pgAdmin) backup generated files as migrations?
I think you are going the wrong way. Flyway is about the migration scripts you execute to propogate DB version. The backup file contains the whole database. If you want to replace the whole database with the new version of it you may simply drop the old one and create the new one, but you will loose data that way. You can of course use flyway to restore the backup for you, but that way you'll get only the version table. If you'll update over several versions, then multiple restores will be performed that is not needed.
How could I make a migration from a development to the production database? Just by adding the remote url from Google Cloud SQL the do the migration?
I tried google'ing (entered "Google Cloud SQL flyway") and the first result pointed me to Umberto D'Ovido post Setup Flyway with Google Cloud SQL I'm sure with a little effor you'll find the instructions.

Restore Wordpress Database Without Backup

So my web hosting company has restored my hosting files (they were deleted due to a complication), but out of my 4 Wordpress installations 2 of them could not be restored.
I have googled how to restore the database but I only come across people who are restoring from a backup, but I have no backup to restore from; I only have the wordpress files.
What steps must I take to get the sites back online? Ie I guess rebuild the database from scratch but I already have the files (hope that makes sense).
I'm not a programmer or a sql expert, but do have a lot of hosting experience and I can tell you this for sure - if all you have are the Wordpress files (the files in your hosting account) but you don't have a copy of the actual database (usually a .sql file or gzip of it) then you cannot simply restore your Wordpress site content.
The files in your hosting account - the Wordpress files such as index.php and so forth - are not where your posts and page content are stored. They are just files that tell Wordpress how to function. All of your references to the actual content of your posts and pages are stored in the database of your Wordpress.
So, you need the database backup in order to restore your Wordpress to what it was before your mishap.
If you're on typical shared hosting (such as a cPanel host) then you can should be able to access your database through your hosting control panel. Most modern hosts provide you with a hosting control panel that includes direct access to your databases - either through a mySQL tool or phpMyAdmin tool within your hosting control panel.
So for example - if you're on a cPanel host you can log into your cPanel and then click the phpMyAdmin icon to discover the databases you have stored there, and from there you can obtain a copy (export) of your database.
If for some reason you don't have access to a hosting control panel with a tool for accessing your databases, then the next thing would be to get the database through shell (ssh) access, which in a lot of cases is not granted to shared hosting customers.
Ultimately if you have a Wordpress database on the server through your hosting account, your web host can give you a copy of your WP database(s) because they're stored on the web server (either locally on the same server as your web site, or on a mass database server where the host keeps them).
At that point you should submit a request to your host asking for copies / dumps / exports of all your databases, and when they provide you with the database files you could import them back into the corresponding database names via a tool within your hosting control panel (such as phpMyAdmin or mySQL section of your hosting control panel).
Bottom line - you can't restore your Wordpress pages and posts back to what they were without a copy of the database for each Wordpress site you run. Your host has those databases on their server still, unless you accidentally deleted them through one of the tools I've mentioned. If your host tells you that they cannot help you obtain a copy of your database files, then you have a real problem if you don't have your own backup. Database files are not something that you simply upload/download via FTP like your standard html / php files. Database files are stored on the web server of your host and in most cases your host can simply provide you with a dump / export / copy of your databases if you request them. If for some reason you don't have access to a hosting control panel toll where your databases are stored, then request them from your host. If they cannot provide the database file to you and you don't have a backup, then you may be looking at starting from scratch.
As a hosting support tech myself, I can tell you that any good host can easily dump a copy of each of your databases into a folder in your account so that you can import them back using a tool like phpMyAdmin within your hosting account. If they tell you they don't have copies of your databases then you either deleted them (not likely, unless you logged into your control panel and did so unwittingly) or you're with a bad service. (Not jumping to conclusions there, just pointing out the fact that if you didn't remove your databases then they're on the server and any good server admin can give you a copy to restore, along with the instructions.)
It doesn't matter that you have all of the regular files (such as the .php files and .jpg file etc...) on the server if you don't have the database in place that they were connected to, because the database is where much of the content paths and specifics are stored and organized. This characteristic is not exclusive to Wordpress - almost every PHP script is database driven relies on a database for serving the content.
NightOwl's answer is excellent; I would like to add just this. You might have automatic databases backup set up for your account and you don't know it. So I suggest you have a look at your control panel to see whether this is true.
Otherwise, ask again your provider for a more complete restore.

How to access my database in PHPMyAdmin from a different computer?

I am working on my Java application in Eclipse that connects to the database and makes some queries with the data. This database has been created and managed in PHPMyAdmin. The database is stored locally and now I would like to make it accessible not only from my computer, but for anyone who will run my application on his computer. Can anyone tell me what is the procedure? How can I make the database "online"? Should I store the database on some remote server? If so, what is the procedure?
I know this question is not so much straight-forward, but I hope you will give me some idea how to deal with it.
Thanks in advance!
In this situation you should store the database on an external server who are better at managing databases with more security/backups etc.
If you're looking for scalability as well you could get an Amazon AWS Micro Instance in the cloud for free for a year which includes a large amount (20GB) of RDS (their relational database service based on MySQL) for free.
There is a great Stack Overflow question on Using PHPMyAdmin to administer Amazon RDS as well to get you started with something you are familiar with.
You can use MySQLDump to copy your current database from your local machine to RDS if you needed.
(A, completely non-extensive, list of) Mysql Hosting Providers
Webfaction - Good web user interface. Does more than just database hosting. Lots of documentation.
Amazons RDS - Cloud based. Reliable. Offers free tier
Rackspace - Cloud based. Excellent customer service.
Or, host your own on something like these
Linode - Has lots of documentation of getting Mysql installed
Digital Ocean - SSDs for great speed. Again great documentation on getting Mysql installed

Web based solution for team with no Server or database

My team which is a part of a university needs me to develop a web based application for them which can be accessed by any team member. However the university doesn't provide us with a database.
We do have a portion in their server but that's for our public website. Even if I put the application on that server, I need to have a database. I can't use an excel sheet for storing all the data cause it will be huge. I am looking for an optimal solution.
Never fear there are a number of non RDBMS (Oracle, MySQL, MS SQL Server, etc.) solutions around.
You can try many of the document databases under No-SQL banner, with some popular options being:
RavenDB if you are developing your web application in the Microsoft stack.
MongoDB is a great well supported open source document database.
BaseX or Sedna are useful XML databases.
Alternately you can look to Cloud (some offer free services, others are commercial and will need to pay for) databases such as:
Amazon RDS
Elasticsearch
Windows Azure
Choose:
http://www.sqlite.org/
http://www.db4o.com/
Both will give you a database ability with no prior machine configuration or setup package.
For a small team group, specially with no more than 3 developers, I would recommend you to look at CloudBees. They offer a free tier where you can have on the same platform a repository, a Continuous Integration tool, so you can build and test your app every time you do a commit, and a runtime environment where you can deploy a Java, a Play or a PHP application. You can also create free databases.
In the case you wanted to have a visual git repository, you can use GitHub and link your source code with your Jenkins job.
In this way, you don't need multiple tools for your development environment.

Need info on Oracle database server

I am not sure If I'm correct in posting in this forum but I need info. I am doing University project which needs couple of oracle database server which are online. I have a cloud application which would access this servers. I tried to find online if I could rent database servers for a week for the test with no luck. Could somebody provide any info on where I could rent oracle database servers.
Thanks,
Shashi
Another option is to commission an Oracle instance on Amazon's Elastic Cloud (EC2). I've done this myself. If you start with an Amazon Machine Image (AMI) that already has Oracle installed, that's most of the work done for you already. Here's more info to get you started:
http://aws.amazon.com/solutions/global-solution-providers/oracle/
I imagine it would be difficult to find plain Oracle database hosting. It's an "Enterprise" thing, which means companies never bother to explain their services on their website. But you can find relatively cheap Oracle APEX hosting. (APEX is a rapid application development for Oracle.) It's probably much cheaper to rent that and use the Oracle functionality that comes with it.
Or you can always install your own system, although Oracle installation can be painful. If this is just for testing, you can download any version. You might want to start with 10g Express Edition: http://www.oracle.com/technetwork/database/express-edition/downloads/index.html
If the Amazon EC solution is unacceptable, the easiest way to go is probably to start with a Linux+Oracle VM, and look for a provider who does VM hosting, or self-host if you have access to a machine somewhere with a permanent internet connection / address.

Resources