SlideShare a Scribd company logo
1 of 18
Export/Import in Dspace & Backup
ARD Prasad
Where Dspace stores data

/dspace/assetstore directory will have all the
− Bitstreams and licenses

PostgreSQL databases contains information on
− Metadata
− Information about Communities
− Information about Collections
− Information about e-groups & authorizations
− Information about E-persons & authorizations
− Host of other information
Export/Import in Dspace

Export and import deal only with bitstreams,
metadata, license and handles.

But NOT information about communities,
collection, members, reviewers etc., access
permissions/restrictions

You can export or Import
− An item or
− All items in a collection
Export command syntax
/dspace/bin/dsrun org.dspace.app.itemexport.ItemExport 
--type=COLLECTION --id=collID 
--dest=dest_dir --number=seq_num
Where
--type can have either the value COLLECTION or ITEM
--id is the handle/collection_or_Item_Id ex: 1849/2
(or 123456789/2 in case you do not have handle)
--dest is destination directory
(directory be created prior before running the script)
--number is sequence number, it can be just 1
Shell Script for exporting
#!/bin/sh
if test $# != 1
then
echo "Usage: $0 <export-directoryname>"
exit
fi
declare collection_id[5]=(2 3 4 5 6 7)
for((i=0; i<=5; i++))
do
mkdir $1/${collection_id[$i]}
/dspace/bin/dsrun
org.dspace.app.itemexport.ItemExport 
--type=COLLECTION 
--id=1849/${collection_id[$i]} 
--dest=$1/${collection_id[$i]} 
--number=1
done
In the shell script...

Look for the line

declare collection_id[5]=(2 3 4 5 6 7)

Change 2 3 4 etc with your collection ids

Clue: collection ids are the one that appear in the
browser URL after handle prefix, ie. If you have not
registered with CNRI, the number that appears after
123456789/

Also create the directory where the data should be
exported to
Shell Script for Import
#!/bin/sh
declare collection_id[5]=(2 3 4 5 6 7)
for((i=0; i<=5; i++))
do
/dspace/bin/dsrun
org.dspace.app.itemimport.ItemImport 
-a -e dspace@localhost.localdomain 
-c 123456789/${collection_id[$i]} 
-s $1/${collection_id[$i]} 
-m mapfile
done

Here also change the collection ids in the import
progam

-e option, should have the dspace admin id (i.e. e-
mail address)
What is exported

The following files will be created for every item
− dublin_core.xml ( metadata)
− Handle ( one line having the handle number)
− license.txt
− Actual file ( bitstream: could be pdf or doc or an
image file)
− Contents (with two lines – license file name, and
actual bitstream name)
However

Import and Export are meant for data exchange

It can however, be used for partial back up

It takes care of only items

It does not back up
− Your communities, collection, e-groups, e-persons
How to backup postgresql

pg_dump as dspace user

Example:

$ pg_dump dspace > backupfile

Note: where dspace is name of the database

backup file will have all the table definitions and
contents.

pg_dump has lots of options
How to restore database

psql -d dspace –f dumpedfile

Note: pgsql has lots of options, to know more
about options, you can use
Alternative (using tar)

To dump a database called mydb that contains
large objects to a tar file:

$ pg_dump -Ft -b mydb > db.tar

To reload this database (with large objects)
to an existing database called newdb:

$ pg_restore -d newdb db.tar
Upgrading

This procedure should be first step when you are
upgrading DSpace to newer version

Even if upgradation fails, you have back to fall
back
Upgrading Tip

Have different database and as a different user, so
that you do not have to touch the existing DSpace
insallation
Extra care

It is a good idea to take a tape (hard disk) back up
of
− Entire /dspace directory
− pg_dump out put file
− And the export directory
Final Lesson

Learning dspace is too easy.
− can be learnt in a week
− Can be mastered in a month

Creating content is continuous, long-term,
perhaps no end

Be more careful with the Content
Thank You

More Related Content

What's hot

Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files Ahmed El-Arabawy
 
Whirlwind tour of Hadoop and HIve
Whirlwind tour of Hadoop and HIveWhirlwind tour of Hadoop and HIve
Whirlwind tour of Hadoop and HIveEdward Capriolo
 
Archlinux install
Archlinux installArchlinux install
Archlinux installsambismo
 
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linuxkishore1986
 
Introduction to LINUX
Introduction to LINUXIntroduction to LINUX
Introduction to LINUXAVI DHALL
 
Basics of UNIX Commands
Basics of UNIX CommandsBasics of UNIX Commands
Basics of UNIX CommandsSubra Das
 
DNS server configurationDns server configuration
DNS server configurationDns server configurationDNS server configurationDns server configuration
DNS server configurationDns server configurationThamizharasan P
 
Magnetism data addressing
Magnetism data addressingMagnetism data addressing
Magnetism data addressingPooja Shukla
 
supporting t-sql scripts for IndexPage, Datapage and IndexDefragmentation
supporting t-sql scripts for IndexPage, Datapage and IndexDefragmentationsupporting t-sql scripts for IndexPage, Datapage and IndexDefragmentation
supporting t-sql scripts for IndexPage, Datapage and IndexDefragmentationMahabubur Rahaman
 
Introduction to linux day-3
Introduction to linux day-3Introduction to linux day-3
Introduction to linux day-3Gourav Varma
 
DNS Server Configuration
DNS Server ConfigurationDNS Server Configuration
DNS Server Configurationchacheng oo
 
Linux administration training
Linux administration trainingLinux administration training
Linux administration trainingiman darabi
 

What's hot (20)

Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files
 
Tablespaces
TablespacesTablespaces
Tablespaces
 
Whirlwind tour of Hadoop and HIve
Whirlwind tour of Hadoop and HIveWhirlwind tour of Hadoop and HIve
Whirlwind tour of Hadoop and HIve
 
Dns
DnsDns
Dns
 
Archlinux install
Archlinux installArchlinux install
Archlinux install
 
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
 
Unix Basics Commands
Unix Basics CommandsUnix Basics Commands
Unix Basics Commands
 
Unix Basics For Testers
Unix Basics For TestersUnix Basics For Testers
Unix Basics For Testers
 
Hard drives
Hard drivesHard drives
Hard drives
 
Perl Intro 6 Ftp
Perl Intro 6 FtpPerl Intro 6 Ftp
Perl Intro 6 Ftp
 
Introduction to LINUX
Introduction to LINUXIntroduction to LINUX
Introduction to LINUX
 
Apache Spark - Aram Mkrtchyan
Apache Spark - Aram MkrtchyanApache Spark - Aram Mkrtchyan
Apache Spark - Aram Mkrtchyan
 
Basics of UNIX Commands
Basics of UNIX CommandsBasics of UNIX Commands
Basics of UNIX Commands
 
DNS server configurationDns server configuration
DNS server configurationDns server configurationDNS server configurationDns server configuration
DNS server configurationDns server configuration
 
Magnetism data addressing
Magnetism data addressingMagnetism data addressing
Magnetism data addressing
 
supporting t-sql scripts for IndexPage, Datapage and IndexDefragmentation
supporting t-sql scripts for IndexPage, Datapage and IndexDefragmentationsupporting t-sql scripts for IndexPage, Datapage and IndexDefragmentation
supporting t-sql scripts for IndexPage, Datapage and IndexDefragmentation
 
Introduction to linux day-3
Introduction to linux day-3Introduction to linux day-3
Introduction to linux day-3
 
DNS Server Configuration
DNS Server ConfigurationDNS Server Configuration
DNS Server Configuration
 
Linux administration training
Linux administration trainingLinux administration training
Linux administration training
 

Similar to Ingest export

Hadoop & HDFS for Beginners
Hadoop & HDFS for BeginnersHadoop & HDFS for Beginners
Hadoop & HDFS for BeginnersRahul Jain
 
SF Big Analytics 20190612: Building highly efficient data lakes using Apache ...
SF Big Analytics 20190612: Building highly efficient data lakes using Apache ...SF Big Analytics 20190612: Building highly efficient data lakes using Apache ...
SF Big Analytics 20190612: Building highly efficient data lakes using Apache ...Chester Chen
 
Write on memory TSDB database (gocon tokyo autumn 2018)
Write on memory TSDB database (gocon tokyo autumn 2018)Write on memory TSDB database (gocon tokyo autumn 2018)
Write on memory TSDB database (gocon tokyo autumn 2018)Huy Do
 
Postgresql Database Administration Basic - Day2
Postgresql  Database Administration Basic  - Day2Postgresql  Database Administration Basic  - Day2
Postgresql Database Administration Basic - Day2PoguttuezhiniVP
 
You know, for search. Querying 24 Billion Documents in 900ms
You know, for search. Querying 24 Billion Documents in 900msYou know, for search. Querying 24 Billion Documents in 900ms
You know, for search. Querying 24 Billion Documents in 900msJodok Batlogg
 
DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...
DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...
DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...DataStax
 
Big data with HDFS and Mapreduce
Big data  with HDFS and MapreduceBig data  with HDFS and Mapreduce
Big data with HDFS and Mapreducesenthil0809
 
5c_BigData_Hadoop_HDFS.PPTX
5c_BigData_Hadoop_HDFS.PPTX5c_BigData_Hadoop_HDFS.PPTX
5c_BigData_Hadoop_HDFS.PPTXMiguel720844
 

Similar to Ingest export (20)

Nextag talk
Nextag talkNextag talk
Nextag talk
 
Hadoop & HDFS for Beginners
Hadoop & HDFS for BeginnersHadoop & HDFS for Beginners
Hadoop & HDFS for Beginners
 
Linux
Linux Linux
Linux
 
SF Big Analytics 20190612: Building highly efficient data lakes using Apache ...
SF Big Analytics 20190612: Building highly efficient data lakes using Apache ...SF Big Analytics 20190612: Building highly efficient data lakes using Apache ...
SF Big Analytics 20190612: Building highly efficient data lakes using Apache ...
 
Hadoop admin
Hadoop adminHadoop admin
Hadoop admin
 
Hadoop HDFS Concepts
Hadoop HDFS ConceptsHadoop HDFS Concepts
Hadoop HDFS Concepts
 
An Introduction to Hadoop
An Introduction to HadoopAn Introduction to Hadoop
An Introduction to Hadoop
 
Write on memory TSDB database (gocon tokyo autumn 2018)
Write on memory TSDB database (gocon tokyo autumn 2018)Write on memory TSDB database (gocon tokyo autumn 2018)
Write on memory TSDB database (gocon tokyo autumn 2018)
 
Postgresql Database Administration Basic - Day2
Postgresql  Database Administration Basic  - Day2Postgresql  Database Administration Basic  - Day2
Postgresql Database Administration Basic - Day2
 
PostgreSQL Prologue
PostgreSQL ProloguePostgreSQL Prologue
PostgreSQL Prologue
 
Hadoop
HadoopHadoop
Hadoop
 
You know, for search. Querying 24 Billion Documents in 900ms
You know, for search. Querying 24 Billion Documents in 900msYou know, for search. Querying 24 Billion Documents in 900ms
You know, for search. Querying 24 Billion Documents in 900ms
 
DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...
DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...
DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...
 
Linux
LinuxLinux
Linux
 
R stata
R stataR stata
R stata
 
Big data with HDFS and Mapreduce
Big data  with HDFS and MapreduceBig data  with HDFS and Mapreduce
Big data with HDFS and Mapreduce
 
5c_BigData_Hadoop_HDFS.PPTX
5c_BigData_Hadoop_HDFS.PPTX5c_BigData_Hadoop_HDFS.PPTX
5c_BigData_Hadoop_HDFS.PPTX
 
Hadoop 101
Hadoop 101Hadoop 101
Hadoop 101
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 

Recently uploaded

KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 

Recently uploaded (20)

KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 

Ingest export

  • 1. Export/Import in Dspace & Backup ARD Prasad
  • 2. Where Dspace stores data  /dspace/assetstore directory will have all the − Bitstreams and licenses  PostgreSQL databases contains information on − Metadata − Information about Communities − Information about Collections − Information about e-groups & authorizations − Information about E-persons & authorizations − Host of other information
  • 3. Export/Import in Dspace  Export and import deal only with bitstreams, metadata, license and handles.  But NOT information about communities, collection, members, reviewers etc., access permissions/restrictions  You can export or Import − An item or − All items in a collection
  • 4. Export command syntax /dspace/bin/dsrun org.dspace.app.itemexport.ItemExport --type=COLLECTION --id=collID --dest=dest_dir --number=seq_num Where --type can have either the value COLLECTION or ITEM --id is the handle/collection_or_Item_Id ex: 1849/2 (or 123456789/2 in case you do not have handle) --dest is destination directory (directory be created prior before running the script) --number is sequence number, it can be just 1
  • 5. Shell Script for exporting #!/bin/sh if test $# != 1 then echo "Usage: $0 <export-directoryname>" exit fi declare collection_id[5]=(2 3 4 5 6 7) for((i=0; i<=5; i++)) do mkdir $1/${collection_id[$i]} /dspace/bin/dsrun org.dspace.app.itemexport.ItemExport --type=COLLECTION --id=1849/${collection_id[$i]} --dest=$1/${collection_id[$i]} --number=1 done
  • 6. In the shell script...  Look for the line  declare collection_id[5]=(2 3 4 5 6 7)  Change 2 3 4 etc with your collection ids  Clue: collection ids are the one that appear in the browser URL after handle prefix, ie. If you have not registered with CNRI, the number that appears after 123456789/  Also create the directory where the data should be exported to
  • 7. Shell Script for Import #!/bin/sh declare collection_id[5]=(2 3 4 5 6 7) for((i=0; i<=5; i++)) do /dspace/bin/dsrun org.dspace.app.itemimport.ItemImport -a -e dspace@localhost.localdomain -c 123456789/${collection_id[$i]} -s $1/${collection_id[$i]} -m mapfile done
  • 8.  Here also change the collection ids in the import progam  -e option, should have the dspace admin id (i.e. e- mail address)
  • 9. What is exported  The following files will be created for every item − dublin_core.xml ( metadata) − Handle ( one line having the handle number) − license.txt − Actual file ( bitstream: could be pdf or doc or an image file) − Contents (with two lines – license file name, and actual bitstream name)
  • 10. However  Import and Export are meant for data exchange  It can however, be used for partial back up  It takes care of only items  It does not back up − Your communities, collection, e-groups, e-persons
  • 11. How to backup postgresql  pg_dump as dspace user  Example:  $ pg_dump dspace > backupfile  Note: where dspace is name of the database  backup file will have all the table definitions and contents.  pg_dump has lots of options
  • 12. How to restore database  psql -d dspace –f dumpedfile  Note: pgsql has lots of options, to know more about options, you can use
  • 13. Alternative (using tar)  To dump a database called mydb that contains large objects to a tar file:  $ pg_dump -Ft -b mydb > db.tar  To reload this database (with large objects) to an existing database called newdb:  $ pg_restore -d newdb db.tar
  • 14. Upgrading  This procedure should be first step when you are upgrading DSpace to newer version  Even if upgradation fails, you have back to fall back
  • 15. Upgrading Tip  Have different database and as a different user, so that you do not have to touch the existing DSpace insallation
  • 16. Extra care  It is a good idea to take a tape (hard disk) back up of − Entire /dspace directory − pg_dump out put file − And the export directory
  • 17. Final Lesson  Learning dspace is too easy. − can be learnt in a week − Can be mastered in a month  Creating content is continuous, long-term, perhaps no end  Be more careful with the Content