import frappe

def execute():
	frappe.db.sql('''
		UPDATE tabFile
		SET folder = 'Home/Attachments'
		WHERE ifnull(attached_to_doctype, '') != ''
	''')

import frappe

def execute():
	frappe.db.sql('''
		UPDATE tabFile
		SET folder = 'Home/Attachments'
		WHERE ifnull(attached_to_doctype, '') != ''
		AND folder = 'Home'
	''')

Move files only from Home folder
fix(patch): Move files only from Home folder
  import frappe
  
  def execute():
  	frappe.db.sql('''
  		UPDATE tabFile
  		SET folder = 'Home/Attachments'
  		WHERE ifnull(attached_to_doctype, '') != ''
+ 		AND folder = 'Home'
  	''')
  
Move files only from Home folder
## Code Before:
import frappe

def execute():
	frappe.db.sql('''
		UPDATE tabFile
		SET folder = 'Home/Attachments'
		WHERE ifnull(attached_to_doctype, '') != ''
	''')

## Instruction:
Move files only from Home folder
## Code After:
import frappe

def execute():
	frappe.db.sql('''
		UPDATE tabFile
		SET folder = 'Home/Attachments'
		WHERE ifnull(attached_to_doctype, '') != ''
		AND folder = 'Home'
	''')
