sih4sing5hong5 / google-sites-liberation

Fork Version: This is an import/export tool for Google Sites.
https://code.google.com/p/google-sites-liberation/
Apache License 2.0
134 stars 31 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

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
"Changing Access for less secure apps -> Enabled"
is not possible any more...

Original comment by emd...@gmail.com on 4 May 2015 at 12:39

GoogleCodeExporter commented 9 years ago
how to solve?

Original comment by cou.nto....@gmail.com on 28 May 2015 at 5:23

GoogleCodeExporter commented 9 years ago
Pls see previous comments #1, #3: "Set-up an application specific password"

Original comment by emd...@gmail.com on 2 Jun 2015 at 1:53

GoogleCodeExporter commented 9 years ago
can you tell me what the prev. posts #1 and #3 are telling me about creating an 
specific password for liberation app? First there is no "app". So I only can 
choose "other" in the drop down menue. Second, I get an generated password. But 
I cant set the "app" nor username and password. Could you tell me how to do it 
(right)?

Original comment by loemas...@gmail.com on 4 Jun 2015 at 3:11

GoogleCodeExporter commented 9 years ago
How would a google Apps for business user do this? The page specifies that 
setting app specific passwords is not an option for this account type.

Original comment by gns...@gmail.com on 24 Jun 2015 at 1:56

GoogleCodeExporter commented 9 years ago
I am using Google App for Education and have the same question on creating an 
specific password for liberation app. And I also want to try the bat file but I 
should provide the information of "DOMAIN" and "WEBSPACE". How do I add it in 
the bat file?

Original comment by lawyuek...@gmail.com on 21 Jul 2015 at 12:54