<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using python to rename raster in SDE database in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/using-python-to-rename-raster-in-sde-database/m-p/1543379#M45400</link>
    <description>&lt;P&gt;You need to set your workspace environment before executing rename.&amp;nbsp; This lets arcpy know where the data you are referencing by name only lives.&amp;nbsp; Otherwise, I think you can use the full path to the data in rename.&lt;/P&gt;&lt;P&gt;Example setting workspace environment:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/rename.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/rename.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "C:/workspace/test.gdb"

# Set local variables
in_data =  "test"
out_data = "testFC"
data_type = "FeatureClass"

# Run Rename
arcpy.management.Rename(in_data, out_data, data_type)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Sep 2024 12:24:52 GMT</pubDate>
    <dc:creator>Marshal</dc:creator>
    <dc:date>2024-09-27T12:24:52Z</dc:date>
    <item>
      <title>Using python to rename raster in SDE database</title>
      <link>https://community.esri.com/t5/data-management-questions/using-python-to-rename-raster-in-sde-database/m-p/1543376#M45399</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm trying to use Esri python API to access a raster in out SDE database and rename it. This is my shocking attempt at coding it.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Username1_0-1727438145021.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116072iC16977BDEAAD3CF6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Username1_0-1727438145021.png" alt="Username1_0-1727438145021.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For context:&lt;/P&gt;&lt;P&gt;The ultimate goal is at the time of loading data to our Shared SDE, check for a raster dataset with the same name and then take a copy of the version in Shared, rename it and save to our Archived SDE. Then overwrite the Shared version with the new version being loaded. I have an FME workbench that does the checking and archiving steps but I'm struggling to rename raster data so have turned to python but I have very little experience when it comes to coding. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Username1_1-1727438208777.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116073iBC928BEAD9EF3F20/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Username1_1-1727438208777.png" alt="Username1_1-1727438208777.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 11:57:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/using-python-to-rename-raster-in-sde-database/m-p/1543376#M45399</guid>
      <dc:creator>Username1</dc:creator>
      <dc:date>2024-09-27T11:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using python to rename raster in SDE database</title>
      <link>https://community.esri.com/t5/data-management-questions/using-python-to-rename-raster-in-sde-database/m-p/1543379#M45400</link>
      <description>&lt;P&gt;You need to set your workspace environment before executing rename.&amp;nbsp; This lets arcpy know where the data you are referencing by name only lives.&amp;nbsp; Otherwise, I think you can use the full path to the data in rename.&lt;/P&gt;&lt;P&gt;Example setting workspace environment:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/rename.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/rename.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "C:/workspace/test.gdb"

# Set local variables
in_data =  "test"
out_data = "testFC"
data_type = "FeatureClass"

# Run Rename
arcpy.management.Rename(in_data, out_data, data_type)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 12:24:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/using-python-to-rename-raster-in-sde-database/m-p/1543379#M45400</guid>
      <dc:creator>Marshal</dc:creator>
      <dc:date>2024-09-27T12:24:52Z</dc:date>
    </item>
  </channel>
</rss>

