Search code examples
authenticationautomationbackupgoogle-appsgoogle-sites

How to fix login for google-sites-liberation to backup google apps for domain sites again?


For a few days now the backup of google sites using google-sites-liberation stopped working.

The call

java -cp google-sites-liberation.jar com.google.sites.liberation.export.Main -d "$DOMAIN" -w wiki -u "$USER" -p "$PASSWORD" -f "$DIR/" 2>&1

which always worked before now fails with:

May 29, 2015 1:48:23 PM com.google.sites.liberation.export.Main doMain
SEVERE: Invalid User Credentials!
Exception in thread "main" java.lang.RuntimeException: com.google.gdata.util.AuthenticationException: Error authenticating (check service name)
    at com.google.sites.liberation.export.Main.doMain(Main.java:89)
    at com.google.sites.liberation.export.Main.main(Main.java:97)
Caused by: com.google.gdata.util.AuthenticationException: Error authenticating (check service name)
    at com.google.gdata.client.GoogleAuthTokenFactory.getAuthException(GoogleAuthTokenFactory.java:614)
    at com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(GoogleAuthTokenFactory.java:490)
    at com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials(GoogleAuthTokenFactory.java:336)
    at com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:362)
    at com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:317)
    at com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:301)
    at com.google.sites.liberation.export.Main.doMain(Main.java:79)
    ... 1 more

I checked the credentials, the credentials of the account are correct. However it is the main account's password, which probably has more strict security settings on Google now.

I tried to find a solution using Google-Search but only stumbled over old suggestions which had solutions which are no more available today. Also I did not find a way to add an user/password application login to the account used to backup the wiki.

Has anybody a pointer how to fix that and make backup of google site available again?

All answers are good which offer a solution to backup a site:

  • Use some other fully^2 automated tool which does the job of copying an entire site to a directory or archive format, for example .tar.bz2

  • Change google-sites-liberation such, that it uses another authentication method then given in the docs which are a couple of years old now. I did not manage to find it.

  • Note that the account used for backup must not have full google apps for domains administrator access, as this is crucial.

Please no external vendor links except if it is from Google. The data of the site(s) must not be shared with a third party, only Google and me.

Note that the process must be fully^2 automated, but I would like to have it even fully^4 automated:

  • fully^1, because it must run at regular intervals.
  • fully^2, because it must start without user intervention whatsoever (some people define "fully automated" as to start something manually such that it runs by itself, while "automated" means to have a script which still may ask for some additional input)
  • fully^3, because it should not involve user intervention to get the process started (like issuing something like a google authenticator token) at the first run (even if it later runs fully^2 automated)
  • fully^4, because I want to be able to setup the process for several thousands sites in an automated, noninteractive way, when the process which prepares the setup runs on a host which is offline (so the setup can be uploaded to the fully^3 automated system without any additional manual setup steps for example using IPoAC. YKWIM).

Not much of a problem if it is only fully^2 automated, as I only want to backup my little single site (only a few thousand pages with attachments). However I am curious how to get it fully^4 automated, because automating everything (including, but not limited to, the Universe) was my motivation getting into the computer business several decades ago ..

Thanks.

Links:

Update 2015-06-23:

My scripts run every day and they tell if something goes wrong, but not if they work as intended. So I oversaw that it suddenly worked for a few days. But today it failed again:

2015-05-27 to 2015-06-11 (15 days) authentication failure
2015-06-12 to 2015-06-22 (11 days) it works again
2015-06-23               (today)   authentication failure again

I have no idea why it suddenly worked for 11 days. I'll probably update this question again on the next ok-to-fail transition. ;)


Solution

  • Google uses OAuth2 instead of user account/password.

    I fixed the GUI interface. https://github.com/sih4sing5hong5/google-sites-liberation

    But I have no idea about OAuth2 with auto scripts.