difol / google-sites-liberation

Automatically exported from code.google.com/p/google-sites-liberation
0 stars 0 forks source link

Tips and tricks to getting Google Sites Liberation working #98

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I spent some time today getting Google Sites Liberation working on my Windows 7 
machine.  Standing on the Shoulders of Giants -- thank you to those who posted 
information in the past which contributed to this.

Assume the following:
Site:  https://sites.google.com/site/sitefortestingliberation/
User:  Google_User@gmail.com
Pass:  password

1. If you are using 2-step authentication for your Google user account the app 
will error with "Invalid user credentials." Set-up an application specific 
password for the liberation app: 
https://accounts.google.com/b/0/IssuedAuthSubTokens

2. To create a Windows command line export (download to your computer), use the 
following syntax:

java -cp google-sites-liberation-1.0.4.jar 
com.google.sites.liberation.export.Main -h sites.google.com -w 
sitefortestingliberation -u Google_User@gmail.com -p password -f 
site_export_folder -r

3. since I had three sites to liberate, I wrote the following batch file (also 
attached).  Note that I copied the jar file into the ALL_SITES_DIR that will 
also contain folders for each site.

REM This batch file will export all Google Sites from my account using Google 
Sites Liberation java app

REM The following are static variables for each Google site
SET ALL_SITES_DIR=C:\All Google Sites
SET JAR_FILE=google-sites-liberation-1.0.4.jar
SET EXPORT_CLASS=com.google.sites.liberation.export.Main
SET HOST=sites.google.com
SET USERNAME=Google_User@gmail.com
SET PASSWORD=password
SET RESULT_FILE=Site Liberation Log.txt

REM Initialize Log File
ECHO ******** Start Google Sites Data Liberation on %DATE% %TIME% ******** > 
"%ALL_SITES_DIR%\%RESULT_FILE%"
ECHO. >> "%ALL_SITES_DIR%\%RESULT_FILE%"

REM Google Site Liberation for "Site #1"
ECHO ++++++++ Google Site Liberation for "Site #1" ++++++++ >> 
"%ALL_SITES_DIR%\%RESULT_FILE%"
SET WEBSPACE=sitenumber1
SET EXPORT_FOLDER=Site 1
java -cp "%ALL_SITES_DIR%\%JAR_FILE%" %EXPORT_CLASS% -h %HOST% -w %WEBSPACE% -u 
%USERNAME% -p %PASSWORD% -f "%ALL_SITES_DIR%\%EXPORT_FOLDER%" -r >> 
"%ALL_SITES_DIR%\%RESULT_FILE%"
ECHO. >> "%ALL_SITES_DIR%\%RESULT_FILE%"

REM Google Site Liberation for "Site #2"
ECHO ++++++++ Google Site Liberation for "Site #2" ++++++++ >> 
"%ALL_SITES_DIR%\%RESULT_FILE%"
SET WEBSPACE=sitenumber1
SET EXPORT_FOLDER=Site 2
java -cp "%ALL_SITES_DIR%\%JAR_FILE%" %EXPORT_CLASS% -h %HOST% -w %WEBSPACE% -u 
%USERNAME% -p %PASSWORD% -f "%ALL_SITES_DIR%\%EXPORT_FOLDER%" -r >> 
"%ALL_SITES_DIR%\%RESULT_FILE%"
ECHO. >> "%ALL_SITES_DIR%\%RESULT_FILE%"

REM Google Site Liberation for "Site #3"
ECHO ++++++++ Google Site Liberation for "Site #3" ++++++++ >> 
"%ALL_SITES_DIR%\%RESULT_FILE%"
SET WEBSPACE=sitenumber3
SET EXPORT_FOLDER=Site 3
java -cp "%ALL_SITES_DIR%\%JAR_FILE%" %EXPORT_CLASS% -h %HOST% -w %WEBSPACE% -u 
%USERNAME% -p %PASSWORD% -f "%ALL_SITES_DIR%\%EXPORT_FOLDER%" -r >> 
"%ALL_SITES_DIR%\%RESULT_FILE%"
ECHO. >> "%ALL_SITES_DIR%\%RESULT_FILE%"

ECHO ******** End Google Site Data Liberation on %DATE% %TIME% ******** >> 
"%ALL_SITES_DIR%\%RESULT_FILE%"

Original issue reported on code.google.com by Photon...@gmail.com on 27 Mar 2013 at 5:33

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for this:
Set-up an application specific password for the liberation app: 
https://www.google.com/settings/u/1/security

Changing Access for less secure apps -> Enabled
was the key to getting this working for me

Original comment by cozyno...@yahoo.com on 3 Sep 2014 at 5:06

GoogleCodeExporter commented 9 years ago

If you have two way verification ON, then create an application specific 
password.

Original comment by malayama...@gmail.com on 16 Jan 2015 at 9:56