AESH
AESH

Reputation: 1

Stuck on importing bitnami mediawiki in Google Cloud environment

Trying to import a mediawiki.xml into Bitnami mediawiki instance hosted on Google Cloud.

Per Google instructions, moved the xml into the Google Cloud Storage bucket using the browser.

In that browser, I can see the file under what looks like a path - Buckets/2017-11-09-mediawiki_import/mediawiki.xml

Within the Google Cloud SSH client, I am in the Bitnami instance at the path:

me@bitnami-mediawiki-dm-8cff:/opt/bitnami/apps/mediawiki/htdocs/maintenance$ running:

php importDump.php < file name here...

I am not clear what the actual path is to the Google Buckets, or how to find my XML file through the SSH client.

Newb here - so it might be really simple, but I'm not familiar with these tools or command line, any help would be appreciated.

Upvotes: 0

Views: 186

Answers (1)

GalloCedrone
GalloCedrone

Reputation: 5075

Accessing with the URL

If your file doesn't contain any confidential data you can make it public to everyone knowing the URL and download it. From the Google Cloud Platform Console, select "Storage" in the menu, find your bucket and your file and then check the box of the column "Share publicly"

There is a URL for each file and folder and bucket hosted in the Google Cloud having the following format: https://storage.googleapis.com/BUCKETNAME/FOLDER1/FOLDER2/.../FILENAME

Therefore if you have the rights to access the resource you can download the file with any browser or command line tool as curl or wget.

Using $ gsutil

Since your machine has been provided by Google Cloud Compute Engine, and Cloud SDK is already installed, you can use gsutil to access to the bucket.

To copy locally the XML file you stored you can run the following command:

$ gsutil cp gs://2017-11-09-mediawiki_import/mediawiki.xml .

If you get any error, you might need to run gcloud auth login to authenticate yourself and issue the previous command again.

Run the script

Following on of the two solutions, if you succeeded in downloading the file from the bucket, you can run the command:

php importDump.php < mediawiki.xml

Upvotes: 1

Related Questions