{"id":24221,"date":"2024-02-15T14:53:34","date_gmt":"2024-02-15T22:53:34","guid":{"rendered":"https:\/\/docs.extraview.com\/v25\/book\/document-image-field-migration-1\/"},"modified":"2025-04-15T12:31:37","modified_gmt":"2025-04-15T19:31:37","slug":"document-image-field-migration-1","status":"publish","type":"page","link":"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/","title":{"rendered":"Document &#038; Image Field Migration"},"content":{"rendered":"<p>This appendix describes an ExtraView command-line utility named <span class=\"fixedWidthFont\">DocumentImageMigration<\/span> that moves fields with the display types of <em>document<\/em> and <em>image<\/em> from internal storage within the database, to the file system. The utility will typically be run with the support of <span class=\"fixedWidthFont\">doDocumentMigration.bat<\/span> (Windows) or <span class=\"fixedWidthFont\">doDocumentMigration.sh<\/span> (Linux).<\/p>\n<p>By default, the contents of document and image fields uploaded to ExtraView are stored as binary objects in the database. The ExtraView Administrator has the choice to configure the system to store the uploaded field contents on the file system, where they will be accessible by the application server.<\/p>\n<p>The program must be run stand-alone, and the ExtraView application server(s) should be stopped while the documents and images are being migrated.<\/p>\n<p>When planning to migrate documents and images to the file system, it is useful to know the approximate size of the storage required.\u00a0 You can use these SQL statements to provide this information:<\/p>\n<p><code>-- Calculate the total size of current documents\/images files<br \/>\nselect sum(value_blob_size) from image_item_udf;<br \/>\n-- Calculate the total count of current documents and image files<br \/>\nselect count(*) from image_item_udf;<br \/>\n-- Calculate the total size of previous versions, historical documents and image files<br \/>\nselect sum(value_blob_size) from image_item_udf_hist;<br \/>\n-- Calculate the total count of previous versions, historical documents and image files<br \/>\nselect count(*) from image_item_udf_hist;<\/code><\/p>\n<p>For information on setting up and migrating attachments, see these links.<\/p>\n<ul>\n<li><a href=\"v25\/file-attachment-storage-1\/\">File Attachment Storage<\/a><\/li>\n<li><a href=\"v25\/attachment-migration-1\/\">Attachment Migration<\/a><\/li>\n<\/ul>\n<h3>Configuring External Storage<\/h3>\n<div class=\"textGreyBg\">Note: It is strongly recommend that you back up your database prior to performing any of the procedures described below.<\/div>\n<p>To configure the storage options, log in to ExtraView with the Administrator role. These settings are shared with storing <a href=\"v25\/attachment-migration\/\">file attachments<\/a> on the file system. Click on the <b>Admin<\/b> navigation button, then the <b>System Controls<\/b> tab, then select <b>All Behavior Settings<\/b>, and edit the following settings:<\/p>\n<ul>\n<li><b>ATTACHMENT_REPOSITORY_OPT<\/b> &#8211; This setting controls whether attachments, documents and images are stored internally within the database, externally on the file system, or in some combination of the two methods. If the value of this setting is <b>INTERNAL<\/b> (the default value), then all attachments, documents and images are stored internally within the database. If the value is set to <b>EXTERNAL<\/b>, then all the attachments, documents and images are stored on the external file system. Alternatively, you may provide a comma separated list of file extensions and then all files with these extensions are stored in the database while all others are stored externally in the file repository. For example, if you set the value of this setting to <b>txt, doc, docx, htm, html<\/b> then files of these types will be stored within the database. This strategy leaves the files stored internally in the database as searchable by keywords, while image and video files with extensions such as <b>jpg<\/b> and <b>mp4<\/b> are stored externally<\/li>\n<li><b>ATTACHMENT_REPOSITORY_ROOT<\/b> \u2013 This setting defines the location outside the database where attachments, documents and images will be stored. You must ensure that the path is valid from the application server(s) that are running ExtraView and that you have all the permissions to read and write to the storage. In a clustered or load-balanced environment, you must ensure that all instances of ExtraView can read and write to the same file system using this path .Please note \u2013 if you change this setting, new attachments will be saved to the new location, and existing attachments will still reference the old location. You will need to ensure that the previous file path is still accessible by the ExtraView instance, or these existing attachments will not be available to end users. Set up a separate backup method for this external storage as backing up your database will no longer backup the file attachments<\/li>\n<li><b>ATTACHMENT_REPOSITORY_DMAX<\/b> &#8211; This setting defines the maximum number of files or directories that will be created under one node of the external directory structure. The default for this value is 999. It is not likely that this value needs to be altered.<\/li>\n<\/ul>\n<h3>Running the Migration Utility<\/h3>\n<p>The <span class=\"fixedWidthFont\">DocumentImageMigration<\/span> utility is a Java program. This is run from Windows with the <span class=\"fixedWidthFont\">doDocumentMigration.bat<\/span> file, and from Linux with the <span class=\"fixedWidthFont\">doDocumentMigration.sh<\/span> file.\u00a0 You should stop the application server (usually Apache Tomcat) before running this utility and restart it once the utility has completed its task.<\/p>\n<p>The migration command line utility is included in the ExtraView application package. It requires Java be installed on the application server to run. We provide shell and batch file scripts that you can use to run the utility.<\/p>\n<p>If you have deployed ExtraView in a WAR\/EAR file, you will need to set up an exploded directory to run this script. The scripts are located in the <span class=\"fixedWidthFont\">evj\/WEB-INF\/data<\/span> folder on your application server.<\/p>\n<p><b>Syntax:<\/b><\/p>\n<div class=\"fixedWidthFont\">doDocumentMigration [-instanceName] [-testOnly] [-migrate] [-updateSize]<\/div>\n<p>You must provide one of the optional parameters. The meaning of the parameters is:<\/p>\n<ul>\n<li><span class=\"fixedWidthFont\">-instanceName<\/span>\u00a0&#8211; the name of your ExtraView instance, e.g. <em>evj<\/em>. This parameter is required<\/li>\n<li><span class=\"fixedWidthFont\">-testOnly<\/span> &#8211; perform a dry run of the migration, but without making any changes to the database or to the file system<\/li>\n<li><span class=\"fixedWidthFont\">-migrate<\/span> &#8211; perform the migration<\/li>\n<li><span class=\"fixedWidthFont\">-updateSize<\/span> &#8211; update the size of the external attachments in the database (not normally used)<\/li>\n<\/ul>\n<h3>Microsoft Windows with Apache Tomcat<\/h3>\n<p>Edit the <span class=\"fixedWidthFont\">doDocumentMigration.bat<\/span> file.<\/p>\n<p>Locate the lines<\/p>\n<p><span class=\"fixedWidthFont\">set JAVA_HOME=%1<br \/>\nset TOMCAT_HOME=%2<br \/>\nset EV_BASE=%3<\/span><\/p>\n<p>replace <span class=\"fixedWidthFont\">%1<\/span> with your path to Java, e.g. <span class=\"fixedWidthFont\">D:\\ExtraView\\java\\jdk-1.4.2<\/span><br \/>\nreplace <span class=\"fixedWidthFont\">%2<\/span> with your path to Tomcat, e.g. <span class=\"fixedWidthFont\">D:\\ExtraView\\jakarta-tomcat-5.0.28<\/span><br \/>\nreplace <span class=\"fixedWidthFont\">%3<\/span> with your path to ExtraView, e.g. <span class=\"fixedWidthFont\">D:\\ExtraView\\jakarta-tomcat-5.0.28\\webapps\\evj<\/span><\/p>\n<p>Save and exit the edit session.<\/p>\n<p>Open a Command window in the <span class=\"fixedWidthFont\">evj\\WEB-INF\\data<\/span> folder and type the following command:<\/p>\n<p><span class=\"fixedWidthFont\">doDocumentMigration instanceName &#8220;parameter&#8221;<\/span><\/p>\n<p>where<\/p>\n<p><span class=\"fixedWidthFont\">instanceName<\/span> and <span class=\"fixedWidthFont\">&#8220;parameter&#8221;<\/span> are defined by the options listed above.<\/p>\n<h3>Linux \/ Unix with Tomcat<\/h3>\n<p>Edit the <span class=\"fixedWidthFont\">doDocumentMigration.sh<\/span> file.<\/p>\n<p>Locate the lines<\/p>\n<p><span class=\"fixedWidthFont\">TOMCAT_HOME=\/usr\/local\/extraview\/tomcat<br \/>\nJAVA_HOME=\/usr\/local\/extraview\/java<\/span><\/p>\n<p>Set <span class=\"fixedWidthFont\">TOMCAT_HOME<\/span> and <span class=\"fixedWidthFont\">JAVA_HOME<\/span> to the correct paths for your installation.<\/p>\n<p>Save and exit the edit session.<\/p>\n<p>At the command prompt, type the following command:<\/p>\n<p><span class=\"fixedWidthFont\">sh doDocumentMigration.sh instanceName &#8220;parameter&#8221;<\/span><\/p>\n<p>where<\/p>\n<p><span class=\"fixedWidthFont\">instanceName<\/span> and <span class=\"fixedWidthFont\">&#8220;parameter&#8221;<\/span> are defined by the options listed above.<\/p>\n<h3>Completing the Migration<\/h3>\n<div class=\"textGreyBg\">You must use the Java utility named <span class=\"fixedWidthFont\">runPatches<\/span> when you have completed the above steps. The setup for this is identical to the setup for <span class=\"fixedWidthFont\">doDocumentMigration<\/span>, except you edit the file named either <span class=\"fixedWidthFont\">runPatches.bat<\/span> or <span class=\"fixedWidthFont\">runPatches.sh<\/span>. Once you have set up the file, simply run the <span class=\"fixedWidthFont\">runPatches<\/span> from the command line.<\/div>\n<div class=\"textGreyBg\">Again: We strongly recommend that you back up your database prior to performing any of the procedures described above. Please contact support@extraview.com if you would like assistance with this step.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This appendix describes an ExtraView command-line utility named DocumentImageMigration that moves fields with the display types of document and image from internal storage within the database, to the file system. The utility will typically be run with the support of doDocumentMigration.bat (Windows) or doDocumentMigration.sh (Linux). By default, the contents of document and image fields uploaded&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":24211,"menu_order":12,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_lmt_disableupdate":"no","_lmt_disable":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"class_list":["post-24221","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Document &amp; Image Field Migration - Product Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Document &amp; Image Field Migration - Product Documentation\" \/>\n<meta property=\"og:description\" content=\"This appendix describes an ExtraView command-line utility named DocumentImageMigration that moves fields with the display types of document and image from internal storage within the database, to the file system. The utility will typically be run with the support of doDocumentMigration.bat (Windows) or doDocumentMigration.sh (Linux). By default, the contents of document and image fields uploaded...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/\" \/>\n<meta property=\"og:site_name\" content=\"Product Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-15T19:31:37+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/\",\"url\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/\",\"name\":\"Document & Image Field Migration - Product Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/docs.extraview.com\/v25\/#website\"},\"datePublished\":\"2024-02-15T22:53:34+00:00\",\"dateModified\":\"2025-04-15T19:31:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/docs.extraview.com\/v25\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ExtraView 25\",\"item\":\"https:\/\/docs.extraview.com\/v25\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Administration Guide\",\"item\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Appendices &#8211; Admin Guide\",\"item\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Document &#038; Image Field Migration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/#website\",\"url\":\"https:\/\/docs.extraview.com\/v25\/\",\"name\":\"ExtraView Product Documentation\",\"description\":\"ExtraView Documentation\",\"publisher\":{\"@id\":\"https:\/\/docs.extraview.com\/v25\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/docs.extraview.com\/v25\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/#organization\",\"name\":\"ExtraView Corporation\",\"url\":\"https:\/\/docs.extraview.com\/v25\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/docs-stg.extraview.com\/wp-content\/uploads\/2024\/03\/favicon.png\",\"contentUrl\":\"https:\/\/docs-stg.extraview.com\/wp-content\/uploads\/2024\/03\/favicon.png\",\"width\":512,\"height\":512,\"caption\":\"ExtraView Corporation\"},\"image\":{\"@id\":\"https:\/\/docs.extraview.com\/v25\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Document & Image Field Migration - Product Documentation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/","og_locale":"en_US","og_type":"article","og_title":"Document & Image Field Migration - Product Documentation","og_description":"This appendix describes an ExtraView command-line utility named DocumentImageMigration that moves fields with the display types of document and image from internal storage within the database, to the file system. The utility will typically be run with the support of doDocumentMigration.bat (Windows) or doDocumentMigration.sh (Linux). By default, the contents of document and image fields uploaded...","og_url":"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/","og_site_name":"Product Documentation","article_modified_time":"2025-04-15T19:31:37+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/","url":"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/","name":"Document & Image Field Migration - Product Documentation","isPartOf":{"@id":"https:\/\/docs.extraview.com\/v25\/#website"},"datePublished":"2024-02-15T22:53:34+00:00","dateModified":"2025-04-15T19:31:37+00:00","breadcrumb":{"@id":"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/document-image-field-migration-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/docs.extraview.com\/v25\/"},{"@type":"ListItem","position":2,"name":"ExtraView 25","item":"https:\/\/docs.extraview.com\/v25\/"},{"@type":"ListItem","position":3,"name":"Administration Guide","item":"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/"},{"@type":"ListItem","position":4,"name":"Appendices &#8211; Admin Guide","item":"https:\/\/docs.extraview.com\/v25\/extraview-25\/administration-guide-1\/appendices-6\/"},{"@type":"ListItem","position":5,"name":"Document &#038; Image Field Migration"}]},{"@type":"WebSite","@id":"https:\/\/docs.extraview.com\/v25\/#website","url":"https:\/\/docs.extraview.com\/v25\/","name":"ExtraView Product Documentation","description":"ExtraView Documentation","publisher":{"@id":"https:\/\/docs.extraview.com\/v25\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/docs.extraview.com\/v25\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/docs.extraview.com\/v25\/#organization","name":"ExtraView Corporation","url":"https:\/\/docs.extraview.com\/v25\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/docs.extraview.com\/v25\/#\/schema\/logo\/image\/","url":"https:\/\/docs-stg.extraview.com\/wp-content\/uploads\/2024\/03\/favicon.png","contentUrl":"https:\/\/docs-stg.extraview.com\/wp-content\/uploads\/2024\/03\/favicon.png","width":512,"height":512,"caption":"ExtraView Corporation"},"image":{"@id":"https:\/\/docs.extraview.com\/v25\/#\/schema\/logo\/image\/"}}]}},"taxonomy_info":[],"featured_image_src_large":false,"author_info":{"display_name":"carl.koppel","author_link":"https:\/\/docs.extraview.com\/v25\/author\/carl-koppel\/"},"comment_info":0,"_links":{"self":[{"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages\/24221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/comments?post=24221"}],"version-history":[{"count":4,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages\/24221\/revisions"}],"predecessor-version":[{"id":29702,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages\/24221\/revisions\/29702"}],"up":[{"embeddable":true,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages\/24211"}],"wp:attachment":[{"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/media?parent=24221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}